Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 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Из-за этого она не работает? Что я могу сделать?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 430 time(s) in 363 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");
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 Thanks: 3 times
|
Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ? Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr
|
|
|
|
Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 Thanks: 3 times
|
почему то скриншот не видно было Originally Posted by: wise8x8 Спасибо, получилось ! А где почитать простым языком как настраивать новые команды sp.RunProgram и sp.Run ? Я хотел сделать тоже очень простую команду на открытие браузера (и калькулятор по такому же принципу) но формулу пишу неверно http://joxi.ru/EA49pXDToeXjRr
|
|
|
|
Rank: Advanced Member
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 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
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 430 time(s) in 363 post(s)
|
Originally Posted by: wise8x8 почему то скриншот не видно было Originally Posted by: wise8x8 Спасибо, получилось ! А где почитать простым языком как настраивать новые команды 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.
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 Thanks: 3 times
|
Originally Posted by: Rob Originally Posted by: wise8x8 почему то скриншот не видно было Originally Posted by: wise8x8 Спасибо, получилось ! А где почитать простым языком как настраивать новые команды 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. ага, что-то уже начинает получаться, спасибо ! а есть файл где-нибудь с готовыми командами (самыми популярными) скачать чтобы я мог их к себе потом импортировать? :)
|
|
|
|
Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 Thanks: 3 times
|
Originally Posted by: Rob Originally Posted by: wise8x8 почему то скриншот не видно было Originally Posted by: wise8x8 Спасибо, получилось ! А где почитать простым языком как настраивать новые команды 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. интересно что в данном случае браузер открывает новое окно... то-есть у меня уже есть запущенный браузер с вкладками, он просто свернут в трей. . но команда открывает новое окно... а можно отрыть свернутое окно, а не новое?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 430 time(s) in 363 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
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 Thanks: 3 times
|
Originally Posted by: Rob 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
не работает (.... открывает еще одно окно , и сворачивает его в трей... и это не только с хромом так... калькулятор тоже будет открываться несколько окон..
|
|
|
|
Rank: Newbie
Groups: Approved
Joined: 2/21/2022(UTC) Posts: 7 Thanks: 3 times
|
Originally Posted by: Rob 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. я извиняюсь, но никак не найду кнопку вставку кода на страницу, поэтому пишу внутри текста :)
|
|
|
|
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