AutoHotKey

Discuss syntax highlighting or submit new syntax files.
Post Reply
StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

AutoHotKey

Post by StefanG »

Is there a syntax file for autohotkey? I already checked the ahk-Forum, they have ready-made syntax schemes for a dozen editors, but alas, none for JR TextEd.

I did find the old syntax file for Ultra-Edit, and tried to convert it, in the Syntax-Editor, but it still doesn't show up anywhere in the program. How do I tell TextEd to use the converted ahk.syx?
----
Stefan, RJ TextEd portable on Vista 32

jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: AutoHotKey

Post by jgodfrey »

Environment | Add-ons

Select your new highlighter, click "Activate", and provide any file extensions you want to automatically associate with it.

Jeff

StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

Re: AutoHotKey

Post by StefanG »

Thank you jgodfrey,

but it still does not recognize my ahk-file syntax. Here's what I did:
1) Downloaded the UltraEdit wordfile for ahk from the link on the JR-website
2) Imported it under Highlighter > File > Import
3) Saved it out as ahk.syx (the extension was suggested)
4) Did what you suggested: in Add-ons > Highlighters, I browsed for my ahk, it was there now, then added the .ahk extension, then activated it

But nothing is happening to my ahk-files.
It works when I assign it manually from the drop-down in the main window. But I have to do it each and every time, on the next re-open the very same ahk-file will have "Text-File" associated to it again.

I checked the Syntax-Folder: I do have an ahk.ini and an ahk.syx, but NOT an ahk.sxx. Do I need it? How would I create one?
----
Stefan, RJ TextEd portable on Vista 32

jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: AutoHotKey

Post by jgodfrey »

StefanG wrote:But nothing is happening to my ahk-files.
It works when I assign it manually from the drop-down in the main window. But I have to do it each and every time, on the next re-open the very same ahk-file will have "Text-File" associated to it again.
Hmmm... Are you sure you properly assigned the file extension(s) in the Add-ons dialog? The extensions should be listed as ".ext" (so, not *.ext or similar)...
StefanG wrote:I checked the Syntax-Folder: I do have an ahk.ini and an ahk.syx, but NOT an ahk.sxx. Do I need it? How would I create one?
I assume you mean .ssx file? To create one...

- Environment | Options | Highlighters
- Select your highlighter in the drop-down
- Select each highlight "type" in the listbox and assign colors to it
- "Export" the result to an ssx file

Jeff

User avatar
Rickard Johansson
Site Admin
Posts: 6012
Joined: 19 Jul 2006 14:29

Re: AutoHotKey

Post by Rickard Johansson »

You don't really need the .ssx file. It only stores your current colors set for the current highlighter and is only needed when you want to share the syntax files with someone else. The .ssx file is then used by other users to import the colors into there highlighter settings.

StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

Re: AutoHotKey

Post by StefanG »

Hmm, if I don't need the .ssx, then I am out of luck. Tried it several times, but can't get it to work.

Will try it on another machine, and let you know.
----
Stefan, RJ TextEd portable on Vista 32

jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: AutoHotKey

Post by jgodfrey »

StefanG wrote:Will try it on another machine, and let you know.
In case you missed my last post (just before Rickard's), are you sure you got the extension syntax correct?

Jeff

StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

Re: AutoHotKey

Post by StefanG »

Jeff,

thanks for your instructions. I did read them and appreciate your help. But since Rickard ruled out the possibility of the .ssx files being the culprit, I forgot to refer to your posting.

Would you take a look at my screenshot, if it looks ok to you?
ahk.jpg
ahk.jpg (59.95 KiB) Viewed 22128 times
----
Stefan, RJ TextEd portable on Vista 32

jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: AutoHotKey

Post by jgodfrey »

Looks perfect to me. So, just to make sure I understand...

Your new highlighter shows up in the main app's drop-down list and works as expected when you assign it manually, but doesn't work automatically when you open a *.ahk file - is that right?

When you open an "ahk" file, does your highlighter get "selected" in the drop-down list, but simply not properly highlight the text, or does it not even get selected?

Jeff

StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

Re: AutoHotKey

Post by StefanG »

Hey, you're really good at closing in on this problem.
It does not even get selected when I open an .ahk file. It says "Text File" (the first item in the list), although ahk is sitting right there, at number 3, waiting for me to select it.

Well, I guess, it's not that bad, ahk-highlighting does work after all, thanks to your hints. It's only a mouse-click away.
----
Stefan, RJ TextEd portable on Vista 32

jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: AutoHotKey

Post by jgodfrey »

Is it possible that you inadvertently assigned the ".ahk" extension to another highlighter while setting things up (so, it's assigned to more than one)? I've really never seen this problem, but I'm sure it's probably something simple. It's just a matter of finding it...

Jeff

StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

Re: AutoHotKey

Post by StefanG »

Good point, and perfectly possible. I stepped through the whole list - nope, no other occurence of .ahk
----
Stefan, RJ TextEd portable on Vista 32

jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: AutoHotKey

Post by jgodfrey »

Grasping at straws here, but what happens if you:

- Remove the ".ahk" extension from your highlighter (in the Add-ons dialog)
- Close the dialog
- Return to the Add-ons dialog and add the extension again

I'm just wondering if you somehow added a control code (or other non-printable char) into the stored extension.

Jeff

StefanG
Posts: 121
Joined: 11 Dec 2011 22:38
Location: Germany

Re: AutoHotKey

Post by StefanG »

I had tried that, too, Jeff,

removed the ahk, added it again, unpacked a new TextEd to start over from another stick, ran it from a folder on the hard drive ...

My Vista32 laptop just came home from work. And guess what? It works on this machine. Presently I am sitting at my old Win-XP that is hooked up to the internet, and ahk-highlighting does not work.

Isn't that strange? I run TextEd from the exact same USB-stick, same ini and whatever else. Portable. But it behaves differently under XP than under Vista. I am speechless. Beats me how this is possible.

Unfortunately, the ToDo/Note lists from my other thread do not work on either machine.
----
Stefan, RJ TextEd portable on Vista 32

Post Reply