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 : Sunday, June 23, 2019 12:11:03 AM(UTC)
cro_magnon

Rank: Newbie

Reputation:

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

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 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 : Sunday, June 23, 2019 1:42:34 AM(UTC)
cro_magnon

Rank: Newbie

Reputation:

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

Was thanked: 1 time(s) in 1 post(s)
thanks, both codes work fine:)
2014218866  
#4 Posted : Sunday, June 23, 2019 11:58:30 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

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

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")
Rob  
#5 Posted : Sunday, June 23, 2019 2:01:29 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 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/24/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.