sbrady19 wrote: ↑
my original code is from AHK v1 which works, I dont understand the syntax in the v2 documentation
No, as I said, what you posted does not work as you described. It does not respond to a button press, which is what you said it did. It executes immediately up running the script. So if you want this to do the same, then run the following version:
Code: Select all
#Requires AutoHotkey v2.0
buttonnewswin()
buttonnewswin() {
Run '\\folder.xxx.local\Focus Packages'
Sleep 1000
WinMove 69, 185, 700, 396, '\\folder.xxx.local\Focus Packages'
Sleep 1000
}
If you want it to respond to a button press, then you need to have it do that. If your original script did that, I would have added it to this script. I can add that if you describe it which button you mean. A button in a GUI that you didn't show? A mouse button hotkey that you didn't show? Some other kind of button?
sbrady19 wrote: ↑
error says left most character (in the WinMove line) is illegal in an expression
It says that because you ran it with v1, not v2. The #Requires line like in the version above will prevent it from trying to run it with v1.