AutoHotkey Community

It is currently May 26th, 2012, 11:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: November 7th, 2009, 4:14 am 
Offline

Joined: November 7th, 2009, 4:02 am
Posts: 5
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 4:26 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
What is the error you're getting?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 4:29 am 
Offline

Joined: February 17th, 2008, 7:09 am
Posts: 536
I think i am getting tired of people not looking for themselfs.

http://www.autohotkey.com/docs/Scripts.htm#ahk2exe

http://www.autohotkey.com/download/Exe2Ahk.exe <- file to decompile

Keep in mind, if you get the script back, all your comments will be gone.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 4:41 am 
Offline

Joined: November 7th, 2009, 4:02 am
Posts: 5
sinkfaze wrote:
What is the error you're getting?

It says "This line does not contain a recognized action"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 4:42 am 
Offline

Joined: November 7th, 2009, 4:02 am
Posts: 5
[quote="rtcvb32"]I think i am getting tired of people not looking for themselfs.

yeah, like you know i didnt try first


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 7th, 2009, 4:59 am 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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 November 7th, 2009, 5:07 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 5:05 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 5:09 am 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 6:11 am 
Offline

Joined: November 7th, 2009, 4:02 am
Posts: 5
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 6:24 am 
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"?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 7:29 am 
Offline

Joined: February 17th, 2008, 7:09 am
Posts: 536
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 6:57 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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 November 7th, 2009, 7:24 pm, edited 7 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 7:08 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Happens to new users fairly often, have a look at the threads here:
http://www.autohotkey.com/forum/viewtop ... 031#140031

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 9:50 pm 
Offline

Joined: November 7th, 2009, 4:02 am
Posts: 5
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]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2009, 10:13 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Pulover, rbrtryn, XstatyK, Yahoo [Bot] and 41 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group