Jump to content

Setting default SciTE user parameters?


Go to solution Solved by MHz,

Recommended Posts

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! ....
Link to comment
Share on other sites

  • Solution

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.

Link to comment
Share on other sites

Thanks MHz,

That works very well and I can see some strategic directory structure changes at my end with suitable SciTE.properties files. :D

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! ....
Link to comment
Share on other sites

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. :D

Link to comment
Share on other sites

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! ....
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

MHz,

Thanks very much for that tutorial. :thumbsup:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 year later...

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

 

 

 

 

Link to comment
Share on other sites

  • Developers
9 hours ago, 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.

Yes ;)

9 hours ago, 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\

Have you ran the installer as that should create this folder structure?

9 hours ago, philkryder said:

3) Is there a way to alter SciTE such that it uses the ROAMING profile folder rather than the local?

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.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...