Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Establishing a standard/recommended editor for AutoHotkey


  • Please log in to reply
24 replies to this topic

Poll: Would having a standard/recommended editor for AutoHotkey interest you? (74 member(s) have cast votes)

Would having a standard/recommended editor for AutoHotkey interest you?

  1. I don't do enough scripting to justify the use of a customized editor. (1 votes [0.93%])

    Percentage of vote: 0.93%

  2. I write scripts frequently but prefer an extremely simple editor such as Notepad or Metapad. (4 votes [3.74%])

    Percentage of vote: 3.74%

  3. It would have to have some compelling benefits to get me to switch from the editor I use now. (12 votes [11.21%])

    Percentage of vote: 11.21%

  4. If a customized editor became standard/recommended, there's at least a 40% chance I'd use it. (5 votes [4.67%])

    Percentage of vote: 4.67%

  5. If a customized editor became standard/recommended, there's at least an 80% chance I'd use it. (63 votes [58.88%])

    Percentage of vote: 58.88%

  6. I already use an editor customized for AutoHotkey that has all the features I'm likely to want. (21 votes [19.63%])

    Percentage of vote: 19.63%

  7. Other (1 votes [0.93%])

    Percentage of vote: 0.93%

Vote Guests cannot vote
Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

SciTElauncher modifies autohotkeydir setting in ahk.properties for current drive letter and allows help, autocomplete, compile and run from usb drive

Very nice! I had been using Notepad to edit scripts away-from-home. :oops:

I have one suggestion:
EnvSet, SciTE_HOME, %sPath%

If the "SciTE_HOME" environment variable is set on either Windows or GTK+ then it is where both the global and user properties files are found.

(otherwise SciTEUser.properites is put in Documents and Settings, which is not ideal for a portable setup.)

Micahs
  • Members
  • 463 posts
  • Last active: Mar 01 2013 06:01 AM
  • Joined: 01 Dec 2006
Howdy! Thanks for the interest.

I have one suggestion:

(otherwise SciTEUser.properites is put in Documents and Settings, which is not ideal for a portable setup.)

That is a good idea and certainly can't hurt, but it may not be necessary.

On Windows, the global properties file is located in the directory of the executable.

The user properties file is looked for in the user profile directory as set in the USERPROFILE environment variable, or in the directory of the executable if USERPROFILE is not set.


When you use another computer, chances are that it does not have autohotkey installed, and these env vars are not set. In the case where you are using another comp that does have AHK installed, SciTE_HOME env var might come into play. It could prevent you from over-writing any of their prefs or settings, or using their settings to start SciTE. (I have to say, though, that my SciTEUser.properties file is blank! This may be common depending on how customized it is. All my customized stuff is in ahk.properties)
Posted Image

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

When you use another computer, chances are that it does not have autohotkey installed, and these env vars are not set.

Nope, AutoHotkey doesn't use environment variables (unless you specifically tell it to.)

The name "SetEnv" is misleading and is used only for backward compatibility with AutoIt v2. Unlike AutoIt v2, AutoHotkey does not store its variables in the environment. This is because performance would be worse and also because the OS limits such variables to 32K. Use EnvSet instead of SetEnv to write to an environment variable.

USERPROFILE is a standard Windows environment variable (on XP at least), which points to the user's folder (usually C:\Documents and Settings\Username). Unless you use a computer where USERPROFILE has specifically been cleared, it'll be there. Typing "set USERPROFILE" into a command prompt will show you the current value.

If you don't want to unnecessarily set SciTE_Home, you could do this:
EnvGet, up, USERPROFILE
if up
  EnvSet, SciTE_HOME, %sPath%
However, I believe this would be unnecessary, in light of:

An environment variable created or changed with this command will be accessible only to programs the script launches via Run or RunWait.


I tend to leave the default options in SciTEGlobal.properties, AHK-specific stuff in ahk.properties, and use SciTEUser.properties for my personal preferences. (It is blank by default, however I went through the SciTE docs and customized everything to my liking.) In any case, there are only a few computers I edit ahk scripts on, and all of them now have a local copy of SciTE. :)

Micahs
  • Members
  • 463 posts
  • Last active: Mar 01 2013 06:01 AM
  • Joined: 01 Dec 2006

When you use another computer, chances are that it does not have autohotkey installed, and these env vars are not set.

Of course, I meant SciTE, not AHK.

Also, I didn't realize at first that 'USERPROFILE' is OS specific, not SciTE specific. I will add
EnvSet, SciTE_HOME, %sPath%
to SciTElauncher to make it more portable.
Thanks for the insight!
Posted Image

Futurepower(R)
  • Members
  • 38 posts
  • Last active: Oct 11 2014 11:35 PM
  • Joined: 20 Jun 2005
Note that SciTE for AutoHotkey is available. SciTE has an excellent feature: Code folding, which collapses items between braces until you need to see them.

SciTE is the same editor supplied with AutoIt.

http://www.autohotke...pic.php?t=18606

(I chose "Always allow HTML" in my forum profile, but the forum doesn't allow HTML, apparently.)

Micahs
  • Members
  • 463 posts
  • Last active: Mar 01 2013 06:01 AM
  • Joined: 01 Dec 2006
Yeah I saw that. I know SciTE has a lot of cool features, that's why I use it and posted the config I use. Mine is set up for portability, something not addressed in other threads. You can't rely on your usb drive always being "N:\" or whatever. That's where SciTElauncher comes in. It modifies the "AutoHotkeyDir" variable and allows help, execution, and compiling from SciTE anywhere. That's what we were discussing.
Posted Image

Futurepower(R)
  • Members
  • 38 posts
  • Last active: Oct 11 2014 11:35 PM
  • Joined: 20 Jun 2005

Yeah I saw that. I know SciTE has a lot of cool features, that's why I use it and posted the config I use. Mine is set up for portability, something not addressed in other threads.

Could you provide the URL of your configuration method?

You obviously know much more than I about SciTE. I would like to do more configuration of SciTE, but I don't want to spend days learning how. My experience with the documentation is that it is poor, and there is no GUI available for configuration.

Micahs
  • Members
  • 463 posts
  • Last active: Mar 01 2013 06:01 AM
  • Joined: 01 Dec 2006
Well, I didn't just post the config files or anything, it is a complete SciTE package. http://www.autohotke...p=115654#115654
It's in this thread on the first page.
About a gui for SciTE config: https://sourceforge.net/projects/tsct/ I tried it and it seems to cover most of the common stuff that would be needed.
Posted Image

Futurepower(R)
  • Members
  • 38 posts
  • Last active: Oct 11 2014 11:35 PM
  • Joined: 20 Jun 2005

Well, I didn't just post the config files or anything, it is a complete SciTE package.

I'm very enthusiastic about SciTE. It seems like the editor we need. I like that it doesn't use the Windows registry and can be run from any drive, including a USB drive, as shown below.

Anyone not liking the bold syntax highlighting of the package linked above can try my autohotkey.properties file, also linked above. Micahs does not say below what syntax highlighting he used, but he does give a link to software to change it.

Here is a copy of Micahs's comment on the other page, so that people don't have to go there to get it. The file format, .RAR, is an archive file which can be unpacked using the excellent free 7-Zip, at http://www.7-zip.org/:

I agree. Scintilla-based in general and SciTE in particular.
SciTE is portable, lightweight and flexible. I agree also that it may be a little much for beginners, but according to the license to SciTE it is possible for someone to distribute a "branded" version configured specifically as needed.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose

Here is my portaSciTE setup:
1. It uses PhiLho's lexer
2. AHK compile/run/help already set up (followed PhiLho's instructions)
3. AHK is the default language
4. SciTElauncher modifies autohotkeydir setting in ahk.properties for current drive letter and allows help, autocomplete, compile and run from usb drive
5. SciTElauncher maximizes SciTE after loading itThis allows beginners to just start - without configuring SciTE! If they want to learn to make custom config changes, they can. If not, it works as is.
I have it set up like this:
USB drive root
  +-----AHK
         +-----SciTE
         +-----AutoHotKey
         ------SciTElauncher.exe
This is a standard SciTE v1.71 just set up for AHK. Autohotkey is not included in the rar.
Download
(If you download this, please scan it with your antivirus software before opening it, just in case.)

Here's PhiLho's SciLexer thread and SciTE home if you want to put it together yourself.



Micahs
  • Members
  • 463 posts
  • Last active: Mar 01 2013 06:01 AM
  • Joined: 01 Dec 2006
Howdy,

Here's PhiLho's SciLexer thread and SciTE home if you want to put it together yourself.

Syntax Highlighting is supplied by PhiLho's excellent SciLexer and ahk.properties file I stole - ahh borrowed.
Autohotkey.api is supplied with Autohotkey in 'Extras\Editors\Notepad++ directory', of course.

Yeah, if anyone wants to change the setup, feel free. I think the more exposure PhiLho's lexer gets, the better.
Also, the more people use SciTE the better because the knowledge pool will be larger when it comes to helping beginners (or anyone with "this should be simple, but it isn't" problems.)

[EDIT]
BTW, I noticed that box.net changed the way resources are accessed and the old links do not work anymore. Here are the current locations:
portaSciTE
SciTELauncher
Posted Image