StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
cro_magnon  
#1 Posted : Saturday, June 22, 2019 6:11:03 PM(UTC)
cro_magnon

Rank: Newbie

Reputation:

Groups: Approved
Joined: 6/14/2019(UTC)
Posts: 7

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=UserPostedImage]Audio Settings[/img]
Rob  
#2 Posted : Saturday, June 22, 2019 7:21:03 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 208
United States

Thanks: 4 times
Was thanked: 39 time(s) in 32 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);
cro_magnon  
#3 Posted : Saturday, June 22, 2019 7:42:34 PM(UTC)
cro_magnon

Rank: Newbie

Reputation:

Groups: Approved
Joined: 6/14/2019(UTC)
Posts: 7

thanks, both codes work fine:)
2014218866  
#4 Posted : Sunday, June 23, 2019 5:58:30 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 36
China

Thanks: 6 times
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")
Rob  
#5 Posted : Sunday, June 23, 2019 8:01:29 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 208
United States

Thanks: 4 times
Was thanked: 39 time(s) in 32 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.
thanks 1 user thanked Rob for this useful post.
2014218866 on 6/23/2019(UTC)
Users browsing this topic
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.