| View previous topic :: View next topic |
| Author |
Message |
omarello
Joined: 07 Nov 2009 Posts: 5
|
Posted: Sat Nov 07, 2009 3:14 am Post subject: Autohotkey.exe exits when opened 'cos of an error.need scrip |
|
|
Hello, Im an unexperienced Autohotkey user, I love the program, but use it for the simplest of tasks, mainly shorcuts and hotkeys
The script in which i have lots of shorcuts is named Autohotkey.exe and its in my starup menu. yesterday I saved the script inadvertently with an unrecognized action at a certain line. when I try to open the .exe the program automatically exits because of the error.
How can I retrieve the script inside the Autohotkey.exe?
I know the answer is simple but maybe thats the reason I cant solve it!
thanx! |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 2423
|
|
| Back to top |
|
 |
rtcvb32
Joined: 17 Feb 2008 Posts: 125
|
|
| Back to top |
|
 |
omarello
Joined: 07 Nov 2009 Posts: 5
|
Posted: Sat Nov 07, 2009 3:41 am Post subject: |
|
|
| sinkfaze wrote: | | What is the error you're getting? |
It says "This line does not contain a recognized action" |
|
| Back to top |
|
 |
omarello
Joined: 07 Nov 2009 Posts: 5
|
Posted: Sat Nov 07, 2009 3:42 am Post subject: |
|
|
[quote="rtcvb32"]I think i am getting tired of people not looking for themselfs.
yeah, like you know i didnt try first |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 139
|
Posted: Sat Nov 07, 2009 3:59 am Post subject: Re: Autohotkey.exe exits when opened 'cos of an error.need s |
|
|
| omarello wrote: | | The script in which i have lots of shorcuts is named Autohotkey.exe and its in my starup menu. |
Can I just clarify: you have all your shortcuts complied into an exe called Autohotkey.exe? Why did you call it that? Are you sure this isn't the actual Autohotkey.exe that is installed with the application AutoHotkey?
If you have actually compiled all your shortcuts into an exe... then why don't you just edit the source script file (.ahk file) that has the shortcuts in it and re-compile it?
Please can you check the shortcut you have in the start menu... right click it > Properties. Check what the Target box says - is it something like "C:\Program Files\AutoHotkey\AutoHotkey.exe"? Does it have "xyz.ahk" at the end (substitute xyz with any other file name that you may have chosen)? If so, then it is the "xyz.ahk" script you want, you can just edit that with a text editor.
The reason I am asking this is that you can run (the main application) autohotkey.exe and pass a script name to it in a shortcut if you don't have the program fully installed and associated to .ahk files - I am wondering if this is what you were doing...
Also, check in your My Documents folder - a default script file called AutoHotkey.ahk is created when you first start AHK (if you answer yes to the prompt) - your script may be in there.
Last edited by OceanMachine on Sat Nov 07, 2009 4:07 am; edited 1 time in total |
|
| Back to top |
|
 |
Z_Gecko Guest
|
Posted: Sat Nov 07, 2009 4:05 am Post subject: |
|
|
i suspect, you are misunderstanding something,
when you start the autohotkey.exe a default script is launched (either autohotkey.ini or autohotkey.ahk, i donīt know for shure, i never used that feature).
to edit this script, just right-click on itīs icon in the explorer and select Edit, or open it directly from your editor of choice. this script is usually found in autohotkey-program folder. |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 139
|
Posted: Sat Nov 07, 2009 4:09 am Post subject: |
|
|
Z_Gecko - you had the same thought as me - I was just editing my post!
By default it is Autohotkey.ahk and is created in My Documents. |
|
| Back to top |
|
 |
omarello
Joined: 07 Nov 2009 Posts: 5
|
Posted: Sat Nov 07, 2009 5:11 am Post subject: |
|
|
Ok, the thing is I compiled all my shortcuts into the original AutoHotkey.exe. (to my knowledge Ive never converted a .ahk to a .exe) I cant run this .exe because of an error, and I want the script of that .exe, Ive looked in the MyDocuments folder and it is not there. It isnt at the installation folder or the target folder; Ive tried to rename the .exe to .ahk and just get gibberish
I have a 235 Kb file named Autohotkey.exe and cant access the underlying script |
|
| Back to top |
|
 |
Z_Gecko Guest
|
Posted: Sat Nov 07, 2009 5:24 am Post subject: |
|
|
| Quote: | | Ok, the thing is I compiled all my shortcuts into the original AutoHotkey.exe. (to my knowledge Ive never converted a .ahk to a .exe) | this is confusing. how did you "compile your shortcuts in the original Autohotkey.exe"? |
|
| Back to top |
|
 |
rtcvb32
Joined: 17 Feb 2008 Posts: 125
|
Posted: Sat Nov 07, 2009 6:29 am Post subject: |
|
|
I assumed from his description, that he compiled a ahk to exe and called it autohotkeys.exe. However if he never compiled it, then I'm at a little loss what script he is referring to.
Did you somehow delete it? or are you just not calling it correctly? Easiest way to make it work, is to execute the ahk file, or drag-and-drop it on the autohotkey.exe
BTW having the main exe file in startup won't work very well unless you give it a script to run. |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 139
|
Posted: Sat Nov 07, 2009 5:57 pm Post subject: |
|
|
omarello: Autohotkey.exe does not contain any user-defined scripts itself. The Autohotkey exe is the thing that runs the scripts that you create. Think of it like a .bmp file is 'associated' to 'Paint' for example - if you open "mspaint.exe" you just get a program used to create pictures, however if you double-click on a .bmp file, it opens with mspaint.exe and you see the actual picture you created. Think of the script kind of like this bmp file - opening the script (ahk file) will run it, but just opening the exe will not run any scripts (unless it is a user-ceated compiled script, but I will cover this in a minute, or there is a default script in one of the below locations).
So, when you first open Autohotkey.exe, it is no use without a script to run, so it prompts you asking if you want to create the default 'example' script, which if you click Yes, it creates a script file called Autohotkey.ahk in your My Documents folder (with the most recent version of AHK).
Now - you don't have to use that script - you could create a new text file called abc.ahk on your Desktop for example, and double click it - this will run the script using Autohotkey.exe, but the abc.ahk file is not in any way part of the Autohotkey.exe file, it is like 'opening the script with the exe'.
The other option you have is to right-click on a script (a .ahk file) and choose "Compile Script" (this is the same as opening the "Convert .ahk to .exe" (AHK2EXE) program and filling in the fields with default values). What this does is create a COMPLETELY NEW exe file, which contains your script and some other stuff to allow it to run as a stand-alone file (i.e. you can then take that .exe file and put it on another computer that doesn't have AHK installed, and it will work).
When you say that you "compiled all my shortcuts into the original AutoHotkey.exe" - this is not possible to do. You could have created a NEW exe that you decided to call AutoHotkey.exe (or this will be the default name of the exe if you decided to compile the 'example' script called Autohotkey.ahk). The important thing is that the raw .ahk (script) file that is used to create the new exe is NOT deleted as part of this process. So... what we are saying is that you should have the source script that contains all your shortcuts somewhere, unless you have manually deleted it (maybe try checking in your Recycle bin if you think this is possible?).
The 235KB file you have called Autohotkey.exe is probably the exe that comes with AHK (this is the script interpreter, as far as I am aware), and this will not contain your shortcuts inside it.
When you said "yesterday I saved the script inadvertently with an unrecognized action at a certain line", then why don't you just open the script again and change the script, instead of trying to run it? If you can't find the script file, maybe try opening the text editor that you were editing it with (notepad maybe?) and go to the File menu - usually there is a list of most recently opened files in there, one of these may be your script. You can't have been exiting an exe directly, so you must have had the actual raw script that you were editing somewhere.
Just saving the script will not automatically compile it, so as I said, your script with the mistake in it should be around on your machine, and this is what you need to edit, not an .exe file.
Also, as per the below post, check these locations:
My Documents -> AutoHotkey.ahk
My Documents -> AutoHotkey.ini
C:\Program Files\AutoHotkey\AutoHotkey.ahk
C:\Program Files\AutoHotkey\AutoHotkey.ini
You may have an older version of autohotkey that creates .ini files, or creates them in a different place than the most recent version does.
If when you start authohotkey, one of the above scripts exists, it will run that script by default, so check the above locations for those files, open them with notepad (or another text editor) and you will probably find one of them is your script.
Good luck! 
Last edited by OceanMachine on Sat Nov 07, 2009 6:24 pm; edited 7 times in total |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
|
| Back to top |
|
 |
omarello
Joined: 07 Nov 2009 Posts: 5
|
Posted: Sat Nov 07, 2009 8:50 pm Post subject: |
|
|
the first thing I tried was to right click on the .exe and edit it, but it doesnt have that choice
my problem seems to be similar to this:
http://www.autohotkey.com/forum/topic34359.html
Ive tried to decompress the file with Exe2ahk.exe but I dont understand how to run it from the command prompt[/url] |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 139
|
Posted: Sat Nov 07, 2009 9:13 pm Post subject: |
|
|
Dude, did you read anything I put?
check these locations:
My Documents -> AutoHotkey.ahk
My Documents -> AutoHotkey.ini
C:\Program Files\AutoHotkey\AutoHotkey.ahk
C:\Program Files\AutoHotkey\AutoHotkey.ini
If any of these files exist, right click and edit them with NOTEPAD (or another TEXT editor)
Did you try any of the other things I suggested? |
|
| Back to top |
|
 |
|