argumentum Posted April 8 Share Posted April 8 (edited) @boat_58 searches for a psychic in an effort to get a response from a forum user last seen in 2016 .... Open a thread in help and support with your question and the code you've got so far Edited April 8 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Nine Posted April 8 Share Posted April 8 (edited) @boat_58 Here without the UDF : #include <GUIConstants.au3> HotKeySet("{F1}", Restart) GUICreate("Test", 150, 70) GUICtrlCreateLabel(@SEC, 40, 30, 50, 20) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func Restart() ShellExecute(@ScriptFullPath, "", @ScriptDir, @compiled ? "" : "run") Exit EndFunc Edited April 8 by Nine better shellExecute robertocm and SOLVE-SMART 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted April 8 Share Posted April 8 Nice and easy @Nine, thanks. But I had to replace this ... ShellExecute(@ScriptFullPath) ... by this ... ShellExecute(@AutoItExe, '/AutoIt3ExecuteScript ' & @ScriptFullPath) ... to get it working. Best regards Sven Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Nine Posted April 8 Share Posted April 8 (edited) Strange, cause it works both compiled and uncompiled for me. Maybe you have edit as default action ? Edited April 8 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted April 8 Share Posted April 8 Okay, interesting. I have to say that I use VSCode instead of SciTE or ISN Studio. Maybe there is a orphaned relation which is default in SciTE, but not in the VSCode settings - I don't know. Anyways, I guess it's good to have two variants, only in case the user also struggles as I did ( for few seconds 😅 ). Best regards Sven Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Nine Posted April 8 Share Posted April 8 Try this line : ShellExecute(@ScriptFullPath, "", @ScriptDir, @compiled ? "" : "run") SOLVE-SMART 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted April 8 Share Posted April 8 That's even better, yes. Because of the compiled variant 👍 . Works fine. Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Andreik Posted April 8 Share Posted April 8 If SciTe is set to open the script by default it needs to specify the appropriate verb. 17 minutes ago, SOLVE-SMART said: ShellExecute(@AutoItExe, '/AutoIt3ExecuteScript ' & @ScriptFullPath) This also might not work under specific circumstances, so better use some quotes around the script path. Link to comment Share on other sites More sharing options...
Nine Posted April 8 Share Posted April 8 (edited) @SOLVE-SMART Great I'll edit the snippet. Thanks for testing. Edited April 8 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted April 9 Share Posted April 9 (edited) Made an enhanced version that informs the script of the restart, keeps track of the number of restarts and transmits actual command line parameters to the restarted script. Works compiled and uncompiled (DOS cmd console and Scite). #include <GUIConstants.au3> #include <Constants.au3> HotKeySet("{F1}", Restart) Global $iRestart = 0 Global $sCmdLine = StringStripWS(@Compiled ? $CmdLineRaw : StringRegExpReplace($CmdLineRaw, '.*?\Q' & @ScriptName & '\E"?\h*(.*)', "$1"), $STR_STRIPTRAILING) If StringInStr($sCmdLine, "/Restart=", $STR_CASESENSE) Then $iRestart = Int(StringRegExpReplace($sCmdLine, ".*\/Restart=(\d+)", "$1")) $sCmdLine = StringRegExpReplace($sCmdLine, "(.*?)\h*\/Restart=\d+", "$1") EndIf GUICreate("[" & $sCmdLine & "]", 300, 70) GUICtrlCreateLabel($iRestart, 40, 30, 50, 20) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func Restart() ShellExecute(@ScriptName, $sCmdLine & " /Restart=" & $iRestart + 1, @ScriptDir, @Compiled ? "" : "run") Exit EndFunc ;==>Restart Edited April 10 by Nine more robust cmd line extractor SOLVE-SMART and argumentum 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now