Script not working on the portable (zipped) 2.0.2 version Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
karmadb
Posts: 2
Joined: 04 Jun 2023, 21:16

Script not working on the portable (zipped) 2.0.2 version

Post by karmadb » 04 Jun 2023, 21:27

Hi guys,

I have this very simple script that helps me get some keystrokes using Alt+key combination.

Code: Select all

!u::Send, [
!i::Send, ]
!o::Send, {{}
!p::Send, {}}
!j::Send, (
!k::Send, )
!h::Send, =
This script has been working totally fine on my personal pc with proper AHK installation. Now, I want to use this script on my corporate device (without admin privilege for AHK installation), hence the zipped/portable version arrives as the solution. However, I bumped into error when running that same script with the AHK 2.0.2 portable, and the error is shown below:
image.png
image.png (13.45 KiB) Viewed 508 times
How did I use my AHK with the portable version? By clicking and dropping my AHK file onto the AutoHotkey64.exe in the folder.

Could you please help me get this script work using AHK portable, guys? Thank you so much.


[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Script not working on the portable (zipped) 2.0.2 version  Topic is solved

Post by boiler » 04 Jun 2023, 21:40

It has nothing to do with it being the portable version and everything to do with it being a v1 script that you are running with v2. Your personal PC clearly runs it using v1. Just translate it to v2 syntax:

Code: Select all

#Requires AutoHotkey 2.0

!u::Send "["
!i::Send "]"
!o::Send "{{}"
!p::Send "{}}"
!j::Send "("
!k::Send ")"
!h::Send "="

karmadb
Posts: 2
Joined: 04 Jun 2023, 21:16

Re: Script not working on the portable (zipped) 2.0.2 version

Post by karmadb » 05 Jun 2023, 03:31

Woohoo!!! Thank you so much. I was not aware of the difference in syntax between v1 and v2. Confirm that it is working now. Thanks heaps @boiler

Post Reply

Return to “Ask for Help (v2)”