Author |
Topic |
|
zhangvxiao
8 Posts |
Posted - 12/13/2015 : 21:03:28
|
hey,Rob,I come again. I run a bat file use acShellExecute,but I need a dynamic arg in the "directory" postion,it's the path of active window. I search for serveral keyword to search in this Forums,but can't find the information I need. So I turn to you again. Thx
|
|
zhangvxiao
8 Posts |
Posted - 12/13/2015 : 23:48:04
|
Also,
acSendKeys("{DELAY=50}^c") acDelay(50) local s = acGetClipboardText() acRunProgram("c:\\windows\\explorer.exe",s,0)
hope you spend little time on another simple question,this is my code, it's purpose is to open a folder through selecting a folder path,like C:\windows but when I use %windir%,it not work,is due to the "%"'s specialty in the acRunProgram arguments?but I don't konw deal with it . |
|
|
Rob
USA
2615 Posts |
Posted - 12/18/2015 : 06:59:30
|
For your first question, there's no easy way to get the directory with the actions currently available in S+. I will have to make an update to add a new action...I'm surprised this hadn't occurred to me before.
For your second question....I would also need to add an action to expand environment strings. Yet again, something I'm surprised I hadn't thought of before!
With Christmas around the corner, I will have some extra time off from work and should be able to release an update. |
|
|
Rob
USA
2615 Posts |
Posted - 12/20/2015 : 13:26:11
|
Added acGetExecutablePath and acExpandEnvironmentString in version 2.8.6.1.
The help and action help have the function details.
Getting paths with actual drive letters (instead of device name) is a nightmare...
Example:
acMessageBox(acExpandEnvironmentString("%windir%")) acMessageBox(acGetExecutablePath(nil, gsx, gsy, 1, 1)) (the 4th parameter is 1, so it will include the exe name as well, change to 0 for only the folder path) |
|
|
Rob
USA
2615 Posts |
Posted - 12/20/2015 : 13:33:15
|
Note that acExpandEnvironmentString will convert all variables in the string, not just one:
acMessageBox(acExpandEnvironmentString("Windows Directory: %windir%\nAppData Folder: %appdata%")) |
|
|
zhangvxiao
8 Posts |
Posted - 12/25/2015 : 02:00:42
|
can't thank u any more,the new version is used£¬Everthing goes well. |
|
|
|
Topic |
|
|
|