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

Notification

Icon
Error

Options
Go to last post Go to first unread
Dauren  
#1 Posted : Sunday, August 9, 2020 12:57:34 PM(UTC)
Dauren

Rank: Newbie

Reputation:

Groups: Approved
Joined: 8/9/2020(UTC)
Posts: 4
Kazakhstan

Thanks: 3 times
And hello everyone, here's a question about shortkeys: How do i write shortkeys in the script? For example "win+E" to open explorer , just writing - sp.SendVKey(vk.RWIN+e"); didn't work though.

Second question is: how do i run executionable? Yes, i searched through forum before creating this topic/question. But the questions were about Windows executionables or opening a site in browser. Again, for example i tried - sp.RunProgram("steam.exe", "", "open", "normal", true, false, false);
But it seems it can't find the program (?) Anyway, thanks in advance!

Edited by user Sunday, August 9, 2020 2:26:20 PM(UTC)  | Reason: Not specified

UserPostedImage
Rob  
#2 Posted : Sunday, August 9, 2020 3:09:03 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 431 time(s) in 364 post(s)
See this link for the writing out SendKeys: Microsoft SendKeys usage

sp.RunProgram is an explicit execute program call, meaning it's trying to open the open from whatever the current directory is (usually, StrokesPlus.net. You have to fully qualify the path and executable, escaping backslashes as well.

For example:
Code:
sp.RunProgram("C:\\Windows\\system32\\notepad.exe", "", "open", "normal", true, false, false);

However, you can also use sp.Run which just does the same thing that Start > Run does, so as long as steam.exe is something in the defined paths, it will run.
Code:
sp.Run("notepad");
thanks 1 user thanked Rob for this useful post.
Dauren on 8/9/2020(UTC)
Rob  
#3 Posted : Sunday, August 9, 2020 3:09:57 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 431 time(s) in 364 post(s)
Also, the Insert Hotkey button in the script editor toolbar is an easy way to get the script for single key combinations.

SendKeys doesn't support the Win key, so use the appropriate VKey calls, example:
Code:
sp.SendModifiedVKeys([vk.LWIN], [vk.VK_E]);

Edited by user Sunday, August 9, 2020 3:11:37 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Rob for this useful post.
Dauren on 8/9/2020(UTC)
Dauren  
#4 Posted : Sunday, August 9, 2020 3:20:24 PM(UTC)
Dauren

Rank: Newbie

Reputation:

Groups: Approved
Joined: 8/9/2020(UTC)
Posts: 4
Kazakhstan

Thanks: 3 times
Originally Posted by: Rob Go to Quoted Post
See this link for the writing out SendKeys: Microsoft SendKeys usage

sp.RunProgram is an explicit execute program call, meaning it's trying to open the open from whatever the current directory is (usually, StrokesPlus.net. You have to fully qualify the path and executable, escaping backslashes as well.

For example:
Code:
sp.RunProgram("C:\\Windows\\system32\\notepad.exe", "", "open", "normal", true, false, false);

However, you can also use sp.Run which just does the same thing that Start > Run does, so as long as steam.exe is something in the defined paths, it will run.
Code:
sp.Run("notepad");


Damn i've already tried script with the path, but it seems like i cracked up somewhere so it didn't work :/
Thank you as always!
UserPostedImage
Syrianux  
#5 Posted : Tuesday, February 20, 2024 12:32:46 PM(UTC)
Syrianux

Rank: Member

Reputation:

Groups: Approved
Joined: 11/17/2023(UTC)
Posts: 16
United Kingdom

Thanks: 4 times
Quote:
sp.RunProgram is an explicit execute program call, meaning it's trying to open the open from whatever the current directory is (usually, StrokesPlus.net. You have to fully qualify the path and executable, escaping backslashes as well.

For example:
Code:
sp.RunProgram("C:\\Windows\\system32\\notepad.exe", "", "open", "normal", true, false, false);


Hi Rob,

I've always wondered about the usage of the part that comes after the path, i.e.:
Code:
"", "open", "normal", true, false, false)


I was trying to find an explanation online, but I couldn't find any. What do those values refer to? Sorry to take up your time and thanks for this great software!
Rob  
#6 Posted : Tuesday, February 20, 2024 2:17:35 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 431 time(s) in 364 post(s)
Each of those additional parameters are explained in the Script Help window under Operating System > RunProgram.

But the basically match many of the common options available under the .NET Process.Start method.
thanks 1 user thanked Rob for this useful post.
Syrianux on 2/21/2024(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.