Script will not run
Script will not run
Hi. I just downloaded AHK onto a new computer. After I created and saved a script (saved as .ahk), I did a right click on the AHK app icon. On my old computer, a list of options popped up with Run Script at the top. After clicking Run Script, the program worked. But now, there is no such option. When I try to run the script, the options are Open, Open File Location, Run as Administrator, Troubleshoot Compatibility, etc. When I double click on the icon or select Open or Run as Addministrator, a help program opens. How can I get this to Run Script? I have followed all instructions and watched the video (and successfully run this program on my last computer). Any help would be appreciated.
Re: Script will not run
How looks your script ?
an example
use a texteditor like notepad or notepad++ ,save this as xy.ahk, doubleclick to run , nothing happens , you must then use the button F2 to start
an example
use a texteditor like notepad or notepad++ ,save this as xy.ahk, doubleclick to run , nothing happens , you must then use the button F2 to start
Code: Select all
$F2::
wa:=A_screenwidth
ha:=A_screenHeight
aac=%a_osversion% `n %a_ostype% `n 64bit=%a_is64bitos% `n %wa%*%ha% `n %a_username%=%a_isadmin% `n %a_computername%
msgbox, 262208, ,%aac%
return
Re: Script will not run
I don't quite follow.
When I open an AutoHotkey Script from Desktop, the following appears at the top of the texteditor (Notepad):
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Not sure what any of that means, but something very similar appeared when I used the program on my old computer.
When I open an AutoHotkey Script from Desktop, the following appears at the top of the texteditor (Notepad):
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Not sure what any of that means, but something very similar appeared when I used the program on my old computer.
Re: Script will not run
these are the first basic recommended lines ( like default commands )
I just added to this example , doubleclick to start
I just added to this example , doubleclick to start
Code: Select all
#NoEnv ;- Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ;- Enable warnings to assist with detecting common errors.
#Singleinstance,force ;- like RELOAD , if start script again didn't ask you that it's already started
SendMode Input ;- Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ;- Ensures a consistent starting directory.
;return
;$F2:: ;- this is a disactivated line ( example hotkey F2 to start if needed )
wa:=A_screenwidth
ha:=A_screenHeight
aac=%a_osversion% `n %a_ostype% `n 64bit=%a_is64bitos% `n %wa%*%ha% `n %a_username%=%a_isadmin% `n %a_computername%
msgbox, 262208, ,%aac%
return
Re: Script will not run
Garry, I still am not following. I have no idea what I'm supposed to do with this. (You probably need to adjust and talk down to me!)
I did, just as a guess, copy your code into the text editor and saved it as .ahk. But the app icon, which I right-click on it, still does not give a Run option.
I did, just as a guess, copy your code into the text editor and saved it as .ahk. But the app icon, which I right-click on it, still does not give a Run option.
Re: Script will not run
ok, dont't know why 'Run Script' is missing by rightclick
but you can run it at least with a doubleclick ? ( Otherwise must define in windows 'Always open with' the ahk- extension )
maybe deinstall and run 'Download Autohotkey Installer ' again (?)
https://autohotkey.com/download/
but you can run it at least with a doubleclick ? ( Otherwise must define in windows 'Always open with' the ahk- extension )
maybe deinstall and run 'Download Autohotkey Installer ' again (?)
https://autohotkey.com/download/
Re: Script will not run
Both double click and right click give the same set of otions: Open, Open in File Location, Run as Administrator, etc. This is frustrating because, as I said, I had no problems when using this program on my last computer.
I suppose I can always try to reinstall, as you suggest. But thanks for looking into it. I appreciate it.
I suppose I can always try to reinstall, as you suggest. But thanks for looking into it. I appreciate it.
Re: Script will not run
maybe if you're not admin , you can't copy files to C:\ etc ...
the msgbox example above shoul'd work without problem
an example to run as admin
the msgbox example above shoul'd work without problem
an example to run as admin
Code: Select all
;- start as admin cmd.exe
MsgBox, % "I am" (A_IsAdmin ? "" : " not") " Admin."
Gosub, RunAsAdmin1
;-----------
run, %comspec% /k date /T&time /T&time ;<<< your command here to change the time ( use ENTER for nothing )
;run, %comspec% /k sfc /scannow
;-----------
Return
;--------------------------------------------------------------------
RunAsAdmin1:
If Not A_IsAdmin
{
try
{
Run, *RunAs %A_ScriptFullPath%
}
Exitapp
}
Return
Re: Script will not run
Garry, I'm really sorry, and I am not trying to be difficult (especially when you are helping me!) but I have no idea what you are asking me to do. I don't know what a msgbox is or where the first example the you refer to is. I don't know what you are suggesting I do with the code you are sending. I can copy this code into the .ahk text and save it (I do know how to do that, and I did do that with the first code you sent), but it won't run becuase I cannot get the app to give me a Run Script option.
Re: Script will not run
ok, I think somebody can help ...... ( If long time no answer ask again )
Re: Script will not run
Robert; perhaps we need to go back to basics, if you don't mind. Could you tell us how you installed AHK? Did you download the .zip or the .exe? (The .exe contains the full installer and is downloaded by clicking on the blue-ish button near the top of the download page - not immediately obvious unfortunately.)
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Script will not run
Hi, Tac.
Initially, I tried the .exe. I kept receiving an Error 404 page. So then I downloaded the .zip file. I could not get the .zip file to run at all, that is, I could not figure out how to install the program once the zip file was downloaded. The next day, I tried the .exe file again, which then worked (apparently, the problem causing the error page was fixed).
If you look at the first picture from my screen I attached, you can see the app icon for AutohotKey, green with an H on it, and the shortcut to the script I am trying to run. The second shows the menu when I right click on the app icon. To repeat what I wrote above, when I tried to use this on my previous computer, I had no problem. When I would right click on the app icon, the popup menu began with Run Script.
Initially, I tried the .exe. I kept receiving an Error 404 page. So then I downloaded the .zip file. I could not get the .zip file to run at all, that is, I could not figure out how to install the program once the zip file was downloaded. The next day, I tried the .exe file again, which then worked (apparently, the problem causing the error page was fixed).
If you look at the first picture from my screen I attached, you can see the app icon for AutohotKey, green with an H on it, and the shortcut to the script I am trying to run. The second shows the menu when I right click on the app icon. To repeat what I wrote above, when I tried to use this on my previous computer, I had no problem. When I would right click on the app icon, the popup menu began with Run Script.
- Attachments
-
- Capture.PNG
- (76.83 KiB) Downloaded 147 times
-
- Capture2.PNG
- (390.35 KiB) Downloaded 147 times
Re: Script will not run
-"AutoHotKey.lnk" < this is a link/shortcut , you don't need this at desktop
( when I click on this I see the same )
-"New AutoHotKey Script.txt" < this is a text-file ( notepad)
Ahk-script it must be renamed e.g. to > "Test.ahk" , ( shoul'd have the ahk-icon ) / not "Test.ahk.txt" , sometimes you can't see the extension , see windows settings
To start ahk-script, doubleclict ahk-script , example > "Test.ahk"
( when I click on this I see the same )
-"New AutoHotKey Script.txt" < this is a text-file ( notepad)
Ahk-script it must be renamed e.g. to > "Test.ahk" , ( shoul'd have the ahk-icon ) / not "Test.ahk.txt" , sometimes you can't see the extension , see windows settings
To start ahk-script, doubleclict ahk-script , example > "Test.ahk"
Re: Script will not run
I do understand that the icon is just a shortcut, but the shortcut is to "C:\Program Files\AutoHotkey\AutoHotkey.exe", the actual program.
The script is a .ahk type of file, as the picture shows. When I save it, I select the All Files option under Save as Type, type ".ahk" as the file extension, and have the Encoding set to UTF-8 (I have no idea what this last thing is, but the tutorial video said to be sure that the encoding was set to this.
The script is a .ahk type of file, as the picture shows. When I save it, I select the All Files option under Save as Type, type ".ahk" as the file extension, and have the Encoding set to UTF-8 (I have no idea what this last thing is, but the tutorial video said to be sure that the encoding was set to this.
- Attachments
-
- Capture3.PNG
- (14.06 KiB) Downloaded 126 times
Re: Script will not run
Here is the settings when I save the textfile.
- Attachments
-
- Capture4.PNG
- (6.48 KiB) Not downloaded yet
Re: Script will not run
strange , I don't know why you don't get the ahk-icon as xy.ahk , at the moment it opens with notepad ( like text )
try to 'always open with' > use Change-Button and select Autohotkey.exe ( maybe must search in explorer Programs )
I have 64-bit computer ( selected 'Autohotkey Unicode 64-bit' always open with )
( ... or maybe other users can better help )
try to 'always open with' > use Change-Button and select Autohotkey.exe ( maybe must search in explorer Programs )
I have 64-bit computer ( selected 'Autohotkey Unicode 64-bit' always open with )
( ... or maybe other users can better help )
Re: Script will not run
OH MY GOSH GARRY THAT DID IT! I works now. Thank you, thank you, thank you.
I right-clicked on the text editor icon, the one labeled New AutoHotKey Script. I selected Open With-->Choose another app-->AutoHotKey Unicode 64 bit, click on Always open with this app, and PRESTO!
I wish I could buy you a beer.
Anyway, I should point out that the step that you pointed me to I don't recall ever seeing in the tutorials, videos, help docs. Maybe everyone else knows what I missed already. But at least it's running.
I right-clicked on the text editor icon, the one labeled New AutoHotKey Script. I selected Open With-->Choose another app-->AutoHotKey Unicode 64 bit, click on Always open with this app, and PRESTO!
I wish I could buy you a beer.
Anyway, I should point out that the step that you pointed me to I don't recall ever seeing in the tutorials, videos, help docs. Maybe everyone else knows what I missed already. But at least it's running.
Re: Script will not run
1. go to the official download link: https://autohotkey.com/download/ahk-install.exe
2. download the 1.1.29.01 .exe installer again
3. run the installer as administrator, hit 'uninstall' if shown and proceed with the uninstallation
4. if 'uninstall' doesnt appear, hit 'install' and install the unicode x64 version
if u still dont have the context menu items, likely something is preventing the installer from writing the necessary keys in the registry. u may opt to enter them manually instead. check if the file paths match:
2. download the 1.1.29.01 .exe installer again
3. run the installer as administrator, hit 'uninstall' if shown and proceed with the uninstallation
4. if 'uninstall' doesnt appear, hit 'install' and install the unicode x64 version
if u still dont have the context menu items, likely something is preventing the installer from writing the necessary keys in the registry. u may opt to enter them manually instead. check if the file paths match:
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\AutoHotkeyScript]
@="AutoHotkey Script"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\DefaultIcon]
@="C:\\Program Files\\AutoHotkey\\AutoHotkey.exe,1"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell]
@="Open"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Compile]
@="Compile Script"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Compile\Command]
@="\"C:\\Program Files\\AutoHotkey\\Compiler\\Ahk2Exe.exe\" /in \"%l\""
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit]
@="Edit Script"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Open]
@="Run Script"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Open\Command]
@="\"C:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\RunAs]
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\RunAs\Command]
@="\"C:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"%1\" %*"
Re: Script will not run
thank you swagfag
here again msgbox example ( some computer-info )
here again msgbox example ( some computer-info )
Code: Select all
#NoEnv ;- Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ;- Enable warnings to assist with detecting common errors.
#Singleinstance,force ;- like RELOAD , if start script again didn't ask you that it's already started
SendMode Input ;- Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ;- Ensures a consistent starting directory.
;return
;$F2:: ;- this is a disactivated line ( example hotkey F2 to start if needed )
wa:=A_screenwidth
ha:=A_screenHeight
aac=OS-Version=%a_osversion%`nOS-Type=%a_ostype%`n64bit=%a_is64bitos%`nScreen=%wa%*%ha%`nUsername=%a_username%`nIsAdmin=%a_isadmin%`nComputername=%a_computername%`nAHK-Version=%a_ahkversion%
msgbox, 262208,Computer-Info,%aac%
return
Who is online
Users browsing this forum: hedehede81 and 276 guests