Deye Posted April 17, 2020 Share Posted April 17, 2020 Hi there I need an idea concerning a custom way to to run a script from scite 1.* So I'd start the script with a few more udfs in the path * When the script starts I will want to copy @ScriptFullPath to the temp\@ScriptName Then straight away exit|run temp\@ScriptName without the need copy all needed includes to the temp\ path 2. Perhaps away so that the main script file won't stay open in scite (as " file is open") so that (just for instace) i will be able to write something in to it Any idea @solving either limitations Link to comment Share on other sites More sharing options...
faustf Posted April 20, 2020 Share Posted April 20, 2020 for give a best help please send a code , the comunity will help you Link to comment Share on other sites More sharing options...
careca Posted April 21, 2020 Share Posted April 21, 2020 What a mess, the only way to run a script from anywhere where the includes (udf's) are not present, is to change the script in the includes path to include the path where said udf's are. Meaning, you could create a script that creates a new file, very similar to the original script, with the correct includes paths, and then maybe create a batch file that starts the temp script, and then you can close the running script. What a mess. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 16 minutes ago, careca said: the only way to run a script from anywhere where the includes (udf's) are not present, is to change the script in the includes path to include the path where said udf's are. Not exactly. There is a special registry value that can be created at "HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt" called "Include". It should be a REG_SZ (string) value. The contents of this value are a semi-colon delimited list of directories that should be searched for files when resolving #include's in addition to the standard locations. “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...
careca Posted April 21, 2020 Share Posted April 21, 2020 Ah, nice, didn't know about that. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Developers Jos Posted April 21, 2020 Developers Share Posted April 21, 2020 11 minutes ago, Nine said: The contents of this value are a semi-colon delimited list of directories that should be searched for files ...which can also be reviewed and modified in SciTEConfig. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 19 minutes ago, Jos said: ...which can also be reviewed and modified in SciTEConfig. ...or change at runtime before the #include are performed, based on an .ini file “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...
Developers Jos Posted April 21, 2020 Developers Share Posted April 21, 2020 mmm ... but then you do have re-shell the same script or else it won't do anything. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Deye Posted April 21, 2020 Author Share Posted April 21, 2020 (edited) @First I thought tried something that seemed to have worked So now whats with this : #include "test.au3" ;if "test.au3" doesnt exist first run this With this line commented Then remember To uncomment For the test If @ScriptDir = @TempDir Then Exit MsgBox("", "", @TempDir) $f = "test.au3" FileOpen($f, 2) FileClose($f) FileCopy(@ScriptName, @TempDir) Local $address = "HKEY_CURRENT_USER\SOFTWARE\AutoIt v3" Local $s = RegRead($address, "Include") If @error Then RegWrite($address, "Include", "REG_SZ", @ScriptDir & ";") Else If Not StringInStr($s, @ScriptDir) Then $s &= @ScriptDir & ";" RegWrite($address, "Include", "REG_SZ", $s) EndIf EndIf MsgBox(0, $address, "Include = " & @CRLF & $s) Exit Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@TempDir & "\" & @ScriptName), "", @SW_HIDE) Edited April 21, 2020 by Deye Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 (edited) ...I see. Not so much of a good idea then... But with a first script that sets the registry and then runs another script with #include like @Deye proposed, it is working perfect... Edited April 21, 2020 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...
Deye Posted April 21, 2020 Author Share Posted April 21, 2020 didn't yet test to much, the script that needs to start from @TempDir errors : can't open include file "test.au3". @Nine how did you make it work then .. Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 I didn't make any fancy stuff (just a POC). I manually delete the registry key value before starting the first script, and it working fine. If I run the second script alone (after deleting the registry key) it doesn't work stating that the includes doesn't exist. First script : RegWrite ("HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt","include","REG_SZ", "C:\Apps\AutoIt\BlockInput") Exit Run (@AutoItExe & " /AutoIt3ExecuteScript Test.au3") Second script : #include <BlockInputEx.au3> _BlockInput ($BI_DISABLE) Sleep (10000) _BlockInput ($BI_ENABLE) If you want to run this, look inside my sig for that UDF. Deye 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...
Deye Posted April 21, 2020 Author Share Posted April 21, 2020 not sure what happened i started off a fresh and it suddenly worked .. Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 Maybe your registry key got corrupted in some way... “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...
Deye Posted April 21, 2020 Author Share Posted April 21, 2020 (edited) And Again everything stopped working even the example above will throw that same error A very similar to my main script environment, Will this example still run for you: expandcollapse popup#include <WinAPIFiles.au3> #include "Test_Tuner_.au3" ;if "Test_Tuner_.au3" doesnt exist first run this With this line commented Then remember To uncomment For the test If @ScriptDir = @TempDir Then Exit MsgBox("", "", @TempDir) Local $sInclude = '' _ & '#include-once' _ & @LF & '#include <StaticConstants.au3>' _ & @LF & '#include <WindowsConstants.au3>' _ & @LF & '#include <GUIConstants.au3>' _ & @LF & '#include <GUIConstantsEx.au3>' _ & @LF & '#include <EditConstants.au3>' _ & @LF & '#include <WinAPISysWin.au3>' _ & @LF & '#include <ProgressConstants.au3>' _ & @LF & '#include <AVIConstants.au3>' _ & @LF & '#include <TreeViewConstants.au3>' _ & @LF & '#include <GuiComboBox.au3>' _ & @LF & '#include <WinAPIDlg.au3>' _ & @LF & '#include <File.au3>' _ & @LF & '#include <GuiMenu.au3>' _ & @LF & '#include <Misc.au3>' _ & @LF & '#include <String.au3>' _ & @LF & '#include <Date.au3>' _ & @LF & '#include <WinAPIGdi.au3>' _ & @LF & '#include <GuiTab.au3>' ;_ ;~ & @LF & '#include "ColorChooser.au3"' _ ;~ & @LF & '#include "FontSelect.au3"' $f = "Test_Tuner_.au3" If Not FileExists($f) Then $h = FileOpen($f, 2) FileWrite($h, $sInclude) FileClose($f) EndIf FileCopy(@ScriptName, @TempDir, 1) If _WinAPI_FileInUse(@TempDir & "\" & @ScriptName) Then Exit MsgBox("", "", "the file " & @TempDir & "\" & @ScriptName & @CRLF & " is open cannot continue the test") If _WinAPI_FileInUse($f) Then Exit MsgBox("", "", "the file " & $f & @CRLF & " is open cannot continue the test") Local $address = "HKEY_CURRENT_USER\SOFTWARE\AutoIt v3" Local $s = RegRead($address, "Include") If @error Then RegWrite($address, "Include", "REG_SZ", @ScriptDir & ";") $s = @ScriptDir & ";" Else If Not StringInStr($s, @ScriptDir) Then $s &= @ScriptDir & ";" RegWrite($address, "Include", "REG_SZ", $s) EndIf EndIf MsgBox(0, $address, "Include = " & $s) Exit Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@TempDir & "\" & @ScriptName), "", @SW_HIDE) ;~ AutoIt Error ;~ --------------------------- ;~ Line 2 (File "C:\Users\user\AppData\Local\Temp\About_running_limitations.au3"): ;~ #include "Test_Tuner_.au3" ;~ Error: Error opening the file. Edited April 21, 2020 by Deye Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 Didn't test it but there a bug in those 3 lines : Local $s = RegRead($address, "Include") MsgBox(0, $address, "Include = " & @CRLF & $s) If @error Then MsgBox will erase the @error, could that be the problem ? “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...
Deye Posted April 21, 2020 Author Share Posted April 21, 2020 (edited) fixed that in my above post added case scenario to deal with a problem if files happen to be as opened anywhere + the error msg to the end Edited April 21, 2020 by Deye Link to comment Share on other sites More sharing options...
Nine Posted April 21, 2020 Share Posted April 21, 2020 Well, I did not test your script cause I do not understand the underlying goals. When testing simple code that cleans and rewrites the registry 100 times. Got no problem. IDK you way want to rethink your approach. “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...
Deye Posted April 22, 2020 Author Share Posted April 22, 2020 @just leaving it here, its still be interesting to know what is the underlining cause that make this tweak stop working at any time I needed this to work with guictrltuner_limitlessau3 where one copy of the script needs run from @tempDir another from @scriptDir &"\saveprogress" dir not together running with this configuration somehow messes up the tweak so that even the simple example won't work any more 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