Loz Posted May 10, 2014 Posted May 10, 2014 Is it possible to set default parameters that are restored every time SciTE is started? I have several parameters I set (via the View -> Parameters menu) every time I start SciTE. These are parameters associated with a major project I have been working on and simulate the command line parameters that can be applied to the projects executable. Thanks .... GOTOs? We don't need no stinkin' GOTOs! ....
Solution MHz Posted May 11, 2014 Solution Posted May 11, 2014 Setting default parameters for a project in a folder of its own. Sure. I will assume you have the latest full Scite4AutoIt3 which will run AutoIt3Wrapper by default. The Local Options used are based on that assumption. Here are 5 steps to do it. 1. Open main script file as current active tab in Scite 2. In Options Menu in Scite, select entry "Open Local Options File" 3. Add contents below into the Local Options file and save. (creates a file, if not already exists, named SciTE.properties in the same dir as the main script file) 4. You can now close the Local Options file in Scite if you wish 5. Running any script in that directory in Scite will use the options set in the Local Options file that will override settings in other existing property files. Some examples to show are below. Local Options file (SciTE.properties) # Use as Local Directory Options file or Directory Options file # Based on Scite4AutoIt3 2014-04-05 # Commands to compile / run your script # Static Parameters (Add your own parameters here) UserParams=Static parameters "like defaults for this project" /ok # Run Production command.go.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "$(FilePath)" /UserParams $(UserParams) $(1) $(2) $(3) $(4) # Run Beta command.0.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "$(FilePath)" /UserParams $(UserParams) $(1) $(2) $(3) $(4) . Main script (main.au3) Global $params For $1 = 1 To $CMDLINE[0] $params &= $CMDLINE[$1] & @CRLF Next MsgBox(0, '', $params) . Running the main script with the Local options file saved in the same directory, will produce this result from the Msgbox. --------------------------- --------------------------- Static parameters like defaults for this project /ok --------------------------- OK --------------------------- The output is the same parameters that the UserParams variable is set as in the Local Options file. You can add to the default parameters using the parameter window in Scite (Shift+F8) and add for example gui_1 in 1st input, gui_2 in 2nd input, gui_3 in 3rd input and gui_4 in 4th input. Run the main script will show this result. --------------------------- --------------------------- Static parameters like defaults for this project /ok gui_1 gui_2 gui_3 gui_4 --------------------------- OK --------------------------- . So now you should now know the basics of having Scite property settings for each project folder.
Loz Posted May 11, 2014 Author Posted May 11, 2014 Thanks MHz, That works very well and I can see some strategic directory structure changes at my end with suitable SciTE.properties files. I assume from your answer that there is no way to pre-populate the 4 fields of the SciTE Parameters dialog at SciTE startup. Loz .... GOTOs? We don't need no stinkin' GOTOs! ....
MHz Posted May 11, 2014 Posted May 11, 2014 Perhaps using the integrated Lua interface you could set the parameters window automatically. This would be something quite more complicated to implement. I will not be looking into that. Hey, there is a some software named AutoIt that may be able to do it with automation or the directors interface to Scite. You could give that a try.
Loz Posted May 11, 2014 Author Posted May 11, 2014 Thanks MHz, I thought of using autoit to pre-populate the dialog fields and may go down that path sometime in the future. But will probably leave it for adhoc, infrequent param value changes. At this time your solution of the SciTE.properties files is working well. I did modify your solution... In SciTEUser.properties I placed any UserParams that I want available across all projects (eg. /debug which opens a standalone debug console for my projects). In the Project directory SciTE.properties files I used the word LocalParams so they didn't overwrite UserParams coming from SciTEUser.properties I placed the Production and Beta run commands In the SciTEUser.properties file so they are available across all projects and modified them so the are using the UserParams from SciTEUser.properties and LocalParams from SciTE.properties (note the $(LocalParams)) # Run Production command.go.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "$(FilePath)" /UserParams $(UserParams) $(LocalParams) $(1) $(2) $(3) $(4) # Run Beta command.0.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "$(FilePath)" /UserParams $(UserParams) $(LocalParams) $(1) $(2) $(3) $(4) Cheers Loz .... GOTOs? We don't need no stinkin' GOTOs! ....
MHz Posted May 11, 2014 Posted May 11, 2014 Loz, Very good of you. You catch on quick. Your changes should work. If your project folders are all under the same directory, then you could use Directory Options rather then User Options so it does not affect scripts system wide. The Directory Options exists not in the same directory as the project, but the parent directory. You may need to enable the property setting of properties.directory.enable=1 to use Directory Options. The Local Options will overrule the Directory Options. The Directory Options file is named SciteDirectory.properties. Refer to the Scite Documentation under the section of "Properties file" for a summary of these property files.
Moderators Melba23 Posted May 11, 2014 Moderators Posted May 11, 2014 MHz,Thanks very much for that tutorial. 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: Reveal hidden contents 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
philkryder Posted January 27, 2016 Posted January 27, 2016 I'm running windows 7 in both 64 bit and 32. I wanted to change the FONTs and cause each AU3 file to open in a new window using: check.if.already.open=0 font.monospace=font:Consolas,size:16 I've been unable to save changes to the SciTEglobal.properties. It seems that I cannot really save changes in the c:\Programs Files\ folder. On further reflection, this is a good thing; So, I tried to save to the SciTEuser.properties. This failed because I didn't have a local SciTE folder: C:\Users\Pkryder\AppData\Local\AutoIT v3\SciTE\ I created the SciTE folder under AutoIT and then the save worked fine. ?questions? 1) should I have opened a new forum thread rather than resurrecting this older (zombie?) thread? This was the closest thread to the topic that I could find when searching. 2) is there some likely error that I made when installing that prevented SciTE from self-creating the sub-folder in C:\Users\Pkryder\AppData\Local\AutoIT v3\ 3) Is there a way to alter SciTE such that it uses the ROAMING profile folder rather than the local? thanks! Phil
Developers Jos Posted January 28, 2016 Developers Posted January 28, 2016 On 1/27/2016 at 9:14 PM, philkryder said: ?questions? 1) should I have opened a new forum thread rather than resurrecting this older (zombie?) thread? This was the closest thread to the topic that I could find when searching. Expand Yes On 1/27/2016 at 9:14 PM, philkryder said: 2) is there some likely error that I made when installing that prevented SciTE from self-creating the sub-folder in C:\Users\Pkryder\AppData\Local\AutoIT v3\ Expand Have you ran the installer as that should create this folder structure? On 1/27/2016 at 9:14 PM, philkryder said: 3) Is there a way to alter SciTE such that it uses the ROAMING profile folder rather than the local? Expand Default is using the %LOCALAPPDATA% path but you could modify this by updating %SCITE_USERHOME% environment. (Again this only exists when the installer was ran) Jos 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.
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