Jump to content


Photo

[SOLVED] cannot launch program


  • Please log in to reply
8 replies to this topic

#1 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 22 May 2012 - 11:25 AM

RunWait, "c:\adresář se soubory\můj program.exe"
System cannot find the file. Must I save my script in Windows 1250 encoding or how should I tell the program that path is in Unicode?

#2 Maestr0

Maestr0
  • Members
  • 649 posts

Posted 22 May 2012 - 12:31 PM

try this:
1. make a shortcut to the program and call it c:\test.lnk
2. change the code to RunWait, c:\test.lnk
3. see if that helps

#3 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 22 May 2012 - 12:33 PM

are you using the Unicode version of AHK_L?

#4 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 22 May 2012 - 02:00 PM

I use Version 1.0.48.05

<!-- m -->http://codepaste.net/kxysep<!-- m -->

#5 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 22 May 2012 - 02:02 PM

normal AHK is not so great with unicode. Try the AHK_L version for your system. make sure you save your script in unicaode format. normal AHK can't read script in unicode format, but AHK_L can.

l.autohotkey.net

#6 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 22 May 2012 - 02:53 PM

Many thanks!

#7 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 22 May 2012 - 03:04 PM

Yet, can you help me with this:

#p::
send ^c
IfWinNotExist , SAPI5 TTSAPP
  RunWait, "P:\PROGRAMY\jiné\TTS Voices\MS Speech SDK 5.1\Bin\TTSApp.exe"
WinActivate , SAPI5 TTSAPP
Click 300, 100
send ^a
send ^v
ControlSend, Speak, SAPI5 TTSAPP
Click 498, 106
; WinMove, SAPI5 TTSAPP, , 200,500
return
Normally when the program is opened (but not active) is will copy text, and activate window and insert text and play. But If I close the window, then I want to open new window and to do the same action as above. But after opening the program by script, nothing plays. Then when I close the program, it looks, that the rest of script starts continuing. But I would want to continue just after the Window is opened by script.

#8 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 22 May 2012 - 03:17 PM

RunWait forces the script to wait until the window is closed. If you do Run, it will run the program, then continue with the script

You should follow Run with WinWait or WinWaitActive to give the program a chance to open.

#9 BrandonHotkey

BrandonHotkey
  • Members
  • 566 posts

Posted 22 May 2012 - 04:27 PM

Now it works :-) thanks