• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Anyone familiar with AutoHotKey scripts? What am I doing wrong?

While watching videos in MPC-HD I save a lot screenshots... for research purposes, which is done by pressing Alt + I, which pops up Windows' 'Save As' dialogue box, then I press Enter to save and close the dialogue box. I do this repeatedly and I would love it if I can automate those steps into a single button press for each time I want to save a screenshot from the video that's playing.

I googled solutions to this and it seems like AutoHotKey should be perfect for this. I read up a couple of short tutorials on it and looked at a few pages of documentation. I modified an example script that was given in a tutorial to do the job I need. I chose the Ctrl key to act as my "save screenshot hotkey", because it's right next to the arrow buttons that I often use to seek forward and backward in the video, and came up with this:

#IfWinActive ahk_class MediaPlayerClassicW

Control::

Send {Alt}i

Sleep 300

Send Enter

return

#IfWinActive

That didn't work. I tried using ^ instead of the world "Control" but that didn't do anything either (what's the difference between Control and ^? Seeing different syntax like that in documentation is throwing me off). I tried removing the #IfWinActive lines, and even reduced the thing to just remapping the Cntrl key to Alt but that doesn't seem to be working either.

I'm editing the script file in Notepad, saving it, then right-click and Run the script.

What am I doing wrong? Please help.

Edit: Actually I just realized MPC-HD was giving off a sound when I press Ctrl (had my speakers off), but it doesn't do that when the script is not running, so something is happening, but still not saving a screenshot or opening the dialogue box.

Edit 2: Ok I managed to get the Save As box to appear by replacing {Alt} with ! in the script, but it's not saving the file automatically...
 
Top Bottom