This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 specify the directory of acShellExecute
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

zhangvxiao

8 Posts

Posted - 12/13/2015 :  21:03:28  Show Profile
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  Show Profile
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 .
Go to Top of Page

Rob

USA
2615 Posts

Posted - 12/18/2015 :  06:59:30  Show Profile  Visit Rob's Homepage
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.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 12/20/2015 :  13:26:11  Show Profile  Visit Rob's Homepage
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)
Go to Top of Page

Rob

USA
2615 Posts

Posted - 12/20/2015 :  13:33:15  Show Profile  Visit Rob's Homepage
Note that acExpandEnvironmentString will convert all variables in the string, not just one:

acMessageBox(acExpandEnvironmentString("Windows Directory: %windir%\nAppData Folder: %appdata%"))
Go to Top of Page

zhangvxiao

8 Posts

Posted - 12/25/2015 :  02:00:42  Show Profile
can't thank u any more,the new version is used£¬Everthing goes well.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000