Thanks for helping me with this, I made the powerpro script just like
you said and saved it in the powerpro scripts folder, then tried to
run it with a button, and I got this error message (I also changed the
path to my path for Word)
Error running command (2): File not found
?"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE"
Error occurred near line 6 which contained:
?"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE"
Press Cancel to end all running scripts.
Monday, April 11, 2005, 2:04:51 AM, you wrote:
sgp> John Morse wrote:
>> Could someone tell me how to make a script that will check to see if
>> a program is running (eg. Microsoft Word) if it is then send keys to
>> it, or if its not, open it then send the keys.
sgp> This should get you started (untested), save into file winword.powerpro in
sgp> your scripts folder, run as .winword from a button
sgp> ; assumes only one instance of winword.exe at the time
sgp> local caption="=winword"
sgp> if( not anywindow(caption) )do
sgp> ; we get here when winword isn't running
sgp> ; change pathname below for your system
sgp> ?"c:\program files\office\office10\winword.exe"
sgp> ; give winword up to 5000 ms to start
sgp> wait.for( 5000,anywindow(caption) )
sgp> endif
sgp> ; winword should be running at this point
sgp> ; send Alt+f to winword, ^ avoids error message if not found
sgp> do("keys {to ^"++caption++"}%f")
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/