Rank: Newbie
Groups: Translators, Approved Joined: 6/14/2019(UTC) Posts: 7
Was thanked: 1 time(s) in 1 post(s)
|
When i assign this as a shortcut to windows, it starts windows audio settings " %windir%\System32\rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1 " is it possible to turn this shortcut into strokesplus javascript code?
[img= ]Audio Settings[/img]
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
This works for me, a direct conversion: Code:sp.RunProgram(`${sp.ExpandEnvironmentVariables("%windir%")}\\System32\\rundll32.exe`, "shell32.dll,Control_RunDLL mmsys.cpl,,1", "open", "normal", true, false, false);
Though, so does this and is easier to read: Code:sp.RunProgram("rundll32.exe", "shell32.dll,Control_RunDLL mmsys.cpl,,1", "open", "normal", true, false, false);
|
|
|
|
Rank: Newbie
Groups: Translators, Approved Joined: 6/14/2019(UTC) Posts: 7
Was thanked: 1 time(s) in 1 post(s)
|
thanks, both codes work fine:)
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 5/6/2019(UTC) Posts: 111 Thanks: 19 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, Rob, can it (sp.RunProgram) allow a particular software to open the text of the clipboard? For example, when word. exe is opened, the text of the clipboard is copied into it. (My word.exe is installed in "D: Software")
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
As far as I know, there's no command line parameter to open Word and using the text on the clipboard. But there is a switch (/w) to open with a blank document, so you could do that, then wait (you may need to change the pause length, depending on the speed of your computer), and then send CTRL+V: Code://Use /w command line switch to start with a blank document
sp.RunProgram("winword.exe", "/w", "open", "normal", true, false, false);
//Wait 2 seconds for Word to load
sp.Pause(2);
//Send CTRL+V to paste clipboard to new document
sp.SendKeys("^v");
You could get more advanced/complicated, but I honestly think it will not be reliable. Meaning, start Word, and wait until the window is loaded before pasting, but it will be prone to certain logic. Like if you already have a Word document open, etc.
|
1 user thanked Rob for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close