MasonMill Posted May 7, 2010 Share Posted May 7, 2010 Where is the file containing @ScriptDir? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2010 Moderators Share Posted May 7, 2010 MasonMill,There is no file - @ScriptDir is a macro generated at runtime.M23 AnonymousX 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MasonMill Posted May 7, 2010 Author Share Posted May 7, 2010 I should have been more clear. When you use iniwrite it writes to a file you designate is what i understand it to do. Where does that file get put? Like for example: IniWrite(@ScriptDir&"\Set.ini","SetFull","Y1","0") Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2010 Moderators Share Posted May 7, 2010 MasonMill,The file will be created in the same folder as the script - that is what the macro @ScriptDir holds.So if your script was in "C:\MasonMill\Scripts", you would be creating the file "C:\MasonMill\Scripts\Set.ini".All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MasonMill Posted May 7, 2010 Author Share Posted May 7, 2010 Oh i see it now. The script was on my desktop so it just puts it on my desktop, or where ever the script is. Thanks! Link to comment Share on other sites More sharing options...
ShawnW Posted May 7, 2010 Share Posted May 7, 2010 except in this case you don't really need to put that. If you just did IniWrite("Set.ini","SetFull","Y1","0") I think it would look in the path local to the script by default. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2010 Moderators Share Posted May 7, 2010 ShawnW,I think it would look in the path local to the script by defaultCorrect! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MvGulik Posted May 7, 2010 Share Posted May 7, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2010 Moderators Share Posted May 7, 2010 (edited) MvGulik, You learn something every day - or at least you should! Although in my defence - unless you specify otherwise, the working folder starts as the script folder. Thanks. M23 Edit: Altered text - se below. Edited May 7, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 7, 2010 Share Posted May 7, 2010 By default, most processes use their folder as the working directory at start time. However, many things can chance the working directory, including a file save dialog. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 7, 2010 Moderators Share Posted May 7, 2010 Richard Robertson, 2 things in 2 minutes - not sure my aged brain can learn this fast! Previous post edited - thanks. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jaenster Posted May 7, 2010 Share Posted May 7, 2010 MasonMill,The file will be created in the same folder as the script - that is what the macro @ScriptDir holds.So if your script was in "C:\MasonMill\Scripts", you would be creating the file "C:\MasonMill\Scripts\Set.ini".All clear? M23only when you run that script mainly (Not as an include)But what he said is true.If ya run your program, from c:\ , and you use @scriptdir&"\hi.ini" it is in c:\hi.iniIf you ever gonna work with includes, it gonna work a bit harder, It is the current map where you work withEver saw the command run() ?if you do for example, run("c:\dir\Myprogram.exe","c:\","")Now his workdir is in c:\. This means that @scriptdir = c:\Someone correct me when i am wrong, didn't used autoit for a long time -jaenster Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 8, 2010 Share Posted May 8, 2010 only when you run that script mainly (Not as an include)But what he said is true.If ya run your program, from c:\ , and you use @scriptdir&"\hi.ini" it is in c:\hi.iniIf you ever gonna work with includes, it gonna work a bit harder, It is the current map where you work withEver saw the command run() ?if you do for example, run("c:\dir\Myprogram.exe","c:\","")Now his workdir is in c:\. This means that @scriptdir = c:\Someone correct me when i am wrong, didn't used autoit for a long time No, @ScriptDir in your example would still be "C:\dir". @WorkingDir would be "C:\". Link to comment Share on other sites More sharing options...
MHz Posted May 8, 2010 Share Posted May 8, 2010 The working directory can be @ScriptDir in case of double click in explorer but starting a script from the registry, a command prompt, a shortcut etc can pass a working directory other the @ScriptDir and you need to accept that and use it. Many installed applications use a passed working directory to access files in the working directory. To have similar behavior for your script, then store the working directory at initial start of script and use that to access files. For some of the examples given, the working directory can be passed to the script and a ini file can be used in the specified working directory. For example: ; store initial working directory at top of script Global Const $STARTWORKINGDIR = @WorkingDir ; you can change the working directory of the script but $STARTWORKINGDIR is same FileChangeDir('Any Dir change will not affect $STARTWORKINGDIR') ; use $STARTWORKINGDIR to access files IniWrite($STARTWORKINGDIR & '\test1.tmp.ini', 'section', 'key', 'value') You could use @ScriptDir instead of $STARTWORKINGDIR used above but you lose the option of using the passed working directory. 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