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

Notification

Icon
Error

Options
Go to last post Go to first unread
wise8x8  
#1 Posted : Monday, February 21, 2022 6:27:09 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
Доброго дня! Я только начал пользоваться программой, но уже столкнулся с проблемой.

Команда acShellExecute не подсвечивается синтаксис, а значит именно по этому она не работает, так как должна? Что мне сделать с ней?

Пример: команда sp.SendVKey подсвечивается красным, и все работает отлично http://joxi.ru/zANy5aqSvY1yq2
Пример: команда sp.RunProgram тоже подсвечивается красным, и все работает отлично http://joxi.ru/12MBQZJflDg1zA

А команда acShellExecute подсвечена черным. http://joxi.ru/BA0M41BfMe1Z6r и тут http://joxi.ru/MAjGMb8CjedoMr

Из-за этого она не работает? Что я могу сделать? Huh
Rob  
#2 Posted : Monday, February 21, 2022 6:33:35 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
acShellExecute is from the old version of S+ and does not exist in the new version.

sp.RunProgram is the equivalent replacement.

Also, for simple commands which do not need any special parameters, you can use sp.Run - for example:
Code:
sp.Run("https://wordstat.yandex.ru");
thanks 1 user thanked Rob for this useful post.
wise8x8 on 2/21/2022(UTC)
wise8x8  
#3 Posted : Monday, February 21, 2022 10:19:55 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ?

Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr
wise8x8  
#4 Posted : Monday, February 21, 2022 10:23:13 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
почему то скриншот не видно было



Originally Posted by: wise8x8 Go to Quoted Post
Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ?

Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr


randomConstant  
#5 Posted : Tuesday, February 22, 2022 6:47:52 AM(UTC)
randomConstant

Rank: Advanced Member

Reputation:

Groups: Translators, Approved
Joined: 7/17/2021(UTC)
Posts: 135

Thanks: 35 times
Was thanked: 18 time(s) in 15 post(s)
Originally Posted by: Rob Go to Quoted Post
acShellExecute is from the old version of S+ and does not exist in the new version.

sp.RunProgram is the equivalent replacement.

Also, for simple commands which do not need any special parameters, you can use sp.Run - for example:
Code:
sp.Run("https://wordstat.yandex.ru");


Ah I see, I was very confused seeing acShellExecute in another post from wise8x8, thanks for clarifying Laugh
Rob  
#6 Posted : Tuesday, February 22, 2022 7:32:09 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
Originally Posted by: wise8x8 Go to Quoted Post
почему то скриншот не видно было



Originally Posted by: wise8x8 Go to Quoted Post
Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ?

Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr



sp.Run only supports 1 parameter:
Code:
sp.Run("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");

If you click Script Help above the script text box, then expand Operating System, you will see the Run and RunProgram entries and parameters.

thanks 1 user thanked Rob for this useful post.
wise8x8 on 2/22/2022(UTC)
wise8x8  
#7 Posted : Tuesday, February 22, 2022 1:17:56 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
Originally Posted by: Rob Go to Quoted Post
Originally Posted by: wise8x8 Go to Quoted Post
почему то скриншот не видно было



Originally Posted by: wise8x8 Go to Quoted Post
Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ?

Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr



sp.Run only supports 1 parameter:
Code:
sp.Run("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");

If you click Script Help above the script text box, then expand Operating System, you will see the Run and RunProgram entries and parameters.



ага, что-то уже начинает получаться, спасибо ! BigGrin

а есть файл где-нибудь с готовыми командами (самыми популярными) скачать чтобы я мог их к себе потом импортировать? :)

wise8x8  
#8 Posted : Tuesday, February 22, 2022 1:54:58 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
Originally Posted by: Rob Go to Quoted Post
Originally Posted by: wise8x8 Go to Quoted Post
почему то скриншот не видно было



Originally Posted by: wise8x8 Go to Quoted Post
Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ?

Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr



sp.Run only supports 1 parameter:
Code:
sp.Run("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");

If you click Script Help above the script text box, then expand Operating System, you will see the Run and RunProgram entries and parameters.



интересно что в данном случае браузер открывает новое окно... то-есть у меня уже есть запущенный браузер с вкладками, он просто свернут в трей. . но команда открывает новое окно... а можно отрыть свернутое окно, а не новое?
Rob  
#9 Posted : Tuesday, February 22, 2022 5:43:26 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
Semes like Chrome is odd in how it creates windows, so it ignores the minimized option for Process.Start.

So other than making some extra script logic to try and find the new window that was created, and minimizing it - that's probably your only option.

But it might be as simple as:
Code:
sp.RunProgram('C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', '', '', 'minimized', false, false, false);
sp.Sleep(250); // Wait 250 milliseconds for Chrome to open
sp.ForegroundWindow().Minimize(); // Minimize the active window
thanks 1 user thanked Rob for this useful post.
wise8x8 on 2/22/2022(UTC)
wise8x8  
#10 Posted : Tuesday, February 22, 2022 6:41:14 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
Originally Posted by: Rob Go to Quoted Post
Semes like Chrome is odd in how it creates windows, so it ignores the minimized option for Process.Start.

So other than making some extra script logic to try and find the new window that was created, and minimizing it - that's probably your only option.

But it might be as simple as:
Code:
sp.RunProgram('C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', '', '', 'minimized', false, false, false);
sp.Sleep(250); // Wait 250 milliseconds for Chrome to open
sp.ForegroundWindow().Minimize(); // Minimize the active window



не работает (.... открывает еще одно окно , и сворачивает его в трей... и это не только с хромом так... калькулятор тоже будет открываться несколько окон..
wise8x8  
#11 Posted : Tuesday, February 22, 2022 6:51:27 PM(UTC)
wise8x8

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/21/2022(UTC)
Posts: 7
Russian Federation

Thanks: 3 times
Originally Posted by: Rob Go to Quoted Post
Semes like Chrome is odd in how it creates windows, so it ignores the minimized option for Process.Start.

So other than making some extra script logic to try and find the new window that was created, and minimizing it - that's probably your only option.

But it might be as simple as:
Code:
sp.RunProgram('C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', '', '', 'minimized', false, false, false);
sp.Sleep(250); // Wait 250 milliseconds for Chrome to open
sp.ForegroundWindow().Minimize(); // Minimize the active window


!! На хроме помогла команда sp.RunOrActivate
то есть я просто прописал sp.RunOrActivate("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
и он перестал открывать новое окно, а возвращает старое из трея :)

а вот с калькулятором так не работает (
написал sp.RunOrActivate("calc"); но все равно открывается новый калькулятор, второй, третий, четвертый ))

p.s. я извиняюсь, но никак не найду кнопку вставку кода на страницу, поэтому пишу внутри текста :)
Users browsing this topic
Guest
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.