Re: Windows script?
Thanks, Jim. That looks promising. Jeremy > On 8 Oct 2018, at 12:37, Jim Hays via 4D_Tech <4d_tech@lists.4d.com> wrote: > > wscript.exe is one way to go. > > To learn how to write the particular script for MS Word on Windows, let it > record a macro of what you want to do. > You can pull the macro out into a text file and run it with wscript (with a > few more commands to get Word started and point at the document). > To record a Macro, you can type in "record a macro" in the "Tell me what > you want to do" box. > Or, go to the Views tab and find Macros on the right. > > Google is your friend - running VBA macros. > > HTH, > > Jim > > > > > > On Sun, Oct 7, 2018 at 6:02 PM Jeremy Roussak via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > >> I have an AppleScript which is called from 4D with four numeric >> parameters. Provided MS Word is running and the cursor is in a table, it >> fills columns 2 to 5 of the table with its parameters and tabs out of the >> last column, probably creating a new row in the table. >> >> I’m now called upon to make the 4D application, and hence the script, work >> under Windows. Sadly, and a bit problematically I haven’t a clue about >> scripting Windows. I imagine it can be done in VB. Any help would be most >> gratefully received! >> >> The AppleScript is below. >> >> Thanks >> >> Jeremy ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Windows script?
wscript.exe is one way to go. To learn how to write the particular script for MS Word on Windows, let it record a macro of what you want to do. You can pull the macro out into a text file and run it with wscript (with a few more commands to get Word started and point at the document). To record a Macro, you can type in "record a macro" in the "Tell me what you want to do" box. Or, go to the Views tab and find Macros on the right. Google is your friend - running VBA macros. HTH, Jim On Sun, Oct 7, 2018 at 6:02 PM Jeremy Roussak via 4D_Tech < 4d_tech@lists.4d.com> wrote: > I have an AppleScript which is called from 4D with four numeric > parameters. Provided MS Word is running and the cursor is in a table, it > fills columns 2 to 5 of the table with its parameters and tabs out of the > last column, probably creating a new row in the table. > > I’m now called upon to make the 4D application, and hence the script, work > under Windows. Sadly, and a bit problematically I haven’t a clue about > scripting Windows. I imagine it can be done in VB. Any help would be most > gratefully received! > > The AppleScript is below. > > Thanks > > Jeremy > > -- paste the arguments into the last four columns of the current table > -- then tab into the first column, probably creating a new row > -- called from the periodic multipliers tab > > on run argv > > if (WordIsRunning()) then > > tell application "Microsoft Word" > > activate > > if (get selection information selection > information type with in table) is "true" then > > set tTable to selection's table 1 > set rowNum to row index of (selection's > row 1) > set colNum to (count tTable's columns) - 4 > > repeat with i from 1 to 4 > set tCell to text object of (get > cell from table tTable row rowNum column (colNum + i)) > set tPara to tCell's paragraph 1 > set tPara's text object's content > to (item i of argv) > end repeat > > set curCol to column index of (selection's > column 1) > > repeat (colNum - curCol + 5) times > tell application "System Events" > keystroke "\t" > end tell > end repeat > > end if > > end tell > > end if > > end run > > on WordIsRunning() > tell application "System Events" > return (bundle identifier of processes) contains > "com.microsoft.Word" > end tell > end WordIsRunning > > ** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Windows script?
I have an AppleScript which is called from 4D with four numeric parameters. Provided MS Word is running and the cursor is in a table, it fills columns 2 to 5 of the table with its parameters and tabs out of the last column, probably creating a new row in the table. I’m now called upon to make the 4D application, and hence the script, work under Windows. Sadly, and a bit problematically I haven’t a clue about scripting Windows. I imagine it can be done in VB. Any help would be most gratefully received! The AppleScript is below. Thanks Jeremy -- paste the arguments into the last four columns of the current table -- then tab into the first column, probably creating a new row -- called from the periodic multipliers tab on run argv if (WordIsRunning()) then tell application "Microsoft Word" activate if (get selection information selection information type with in table) is "true" then set tTable to selection's table 1 set rowNum to row index of (selection's row 1) set colNum to (count tTable's columns) - 4 repeat with i from 1 to 4 set tCell to text object of (get cell from table tTable row rowNum column (colNum + i)) set tPara to tCell's paragraph 1 set tPara's text object's content to (item i of argv) end repeat set curCol to column index of (selection's column 1) repeat (colNum - curCol + 5) times tell application "System Events" keystroke "\t" end tell end repeat end if end tell end if end run on WordIsRunning() tell application "System Events" return (bundle identifier of processes) contains "com.microsoft.Word" end tell end WordIsRunning ** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: windows script issue
OK I get it. How can I turn this into a bat file that returns a value? as it works from command prompt Thanks and regards Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064 mailto:cjmillerinformed-solutions.com Brookline, MA 02446 USA Registered 4D Developer Providers of 4D and Sybase connectivity http://www.informed-solutions.com This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. > On Apr 13, 2018, at 3:09 PM, Timothy Penner via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > At first look, the escaping seems invalid. Specifically, you escape the > folder separator after the drive letter (E:\\) but you are not escaping the > folder separator between the folders themselves > (\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe). Honestly its best to > just use the Folder Separator constant and let 4D handle the escaping for you. > > In addition to that, it seems odd that only part of the path is encapsulated > in quotes... Have you tried escaping the spaces with a backslash instead? > > -Tim ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: windows script issue
On Fri, 13 Apr 2018 15:02:57 -0400, Chuck Miller via 4D_Tech wrote: > Hi All, > > I need to run a command line script on windows to retrieve a password. > > I have filled a text variable to use with launch external process and > set to pasteboard. When I run from cmd prompt. I get expected results > but when tun from launch external process I get nothing no in, no out > no error > > > E:\\"Program Files > (x86)"\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe GetPassword > /p AppDescs.AppID=4D_test /p > Query=Safe=BWH_Pathology_;Folder=Root;Object="Operating > System-PHS_WinDomain_" /o Password well, from my recent experience... - the quotes inside the path might be a problem ("Program Files (x86)"). as I seem to believe the entire path needs to be quoted. - From what Keisuke was saying (or at least what I understood), you might need to pass the parameters to the exe in the LEP_IN variable > > Any ideas out there > > Regards > > > Chuck > > Chuck Miller Voice: (617) 739-0306 > Informed Solutions, Inc. Fax: (617) 232-1064 > mailto:cjmillerinformed-solutions.com > Brookline, MA 02446 USA Registered 4D Developer >Providers of 4D and Sybase connectivity > http://www.informed-solutions.com > > This message and any attached documents contain information which may > be confidential, subject to privilege or exempt from disclosure under > applicable law. These materials are intended only for the use of the > intended recipient. If you are not the intended recipient of this > transmission, you are hereby notified that any distribution, > disclosure, printing, copying, storage, modification or the taking of > any action in reliance upon this transmission is strictly > prohibited. Delivery of this message to any person other than the > intended recipient shall not compromise or waive such > confidentiality, privilege or exemption from disclosure as to this > communication. > > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** --- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: windows script issue
At first look, the escaping seems invalid. Specifically, you escape the folder separator after the drive letter (E:\\) but you are not escaping the folder separator between the folders themselves (\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe). Honestly its best to just use the Folder Separator constant and let 4D handle the escaping for you. In addition to that, it seems odd that only part of the path is encapsulated in quotes... Have you tried escaping the spaces with a backslash instead? -Tim ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
windows script issue
Hi All, I need to run a command line script on windows to retrieve a password. I have filled a text variable to use with launch external process and set to pasteboard. When I run from cmd prompt. I get expected results but when tun from launch external process I get nothing no in, no out no error E:\\"Program Files (x86)"\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe GetPassword /p AppDescs.AppID=4D_test /p Query=Safe=BWH_Pathology_;Folder=Root;Object="Operating System-PHS_WinDomain_" /o Password Any ideas out there Regards Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064 mailto:cjmillerinformed-solutions.com Brookline, MA 02446 USA Registered 4D Developer Providers of 4D and Sybase connectivity http://www.informed-solutions.com This message and any attached documents contain information which may be confidential, subject to privilege or exempt from disclosure under applicable law. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **