I buy a lot of game bundles. A lot. So many, in fact, that I wrote an Apple script that runs through the Steam redemption automatically. (I don't currently have a decent PC, and many of the games included in these bundles are Mac-compatible anyway, so all of my key redemption is on OS X.)
Paste this code into Applescript Editor and save it as a script, and when you want to redeem a Steam key, copy the key to the clipboard and launch the script. I currently have the script included in my Quicksilver catalog so I can launch the script with only a couple keypresses.
It's not pretty, but it saves me from carpel tunnel.
if application "steam" is running then
tell application "steam"
activate
tell application "System Events" to tell process "steam" to key code 53 --Press ESCAPE to clear any open Steam overlaid windows
delay 0.5
tell application "System Events" to tell process "Steam"
click menu item "Activate a Product on Steam..." of menu "Games" of menu bar 1 --Click through Steam's menu
delay 0.5
tell application "System Events" to tell process "steam" to key code 36 --Press ENTER through first message
delay 0.5
tell application "System Events" to tell process "steam" to key code 36 -- Press ENTER through license agreement
delay 0.5
key down command --Hold COMMAND key
delay 1
tell application "System Events" to tell process "steam" to key code 9 --Press "V," pastes clipboard contents when combined with currently held COMMAND key
delay 1
key up command --Release COMMAND key
delay .5
tell application "System Events" to tell process "steam" to key code 36 --Press ENTER to process Steam key
delay 3
tell application "System Events" to tell process "steam" to key code 53 --Press ESCAPE to close overlaid Steam window, to skip installing
end tell
end tell
end if
if application "steam" is not running then
tell application "steam" to activate --If script is run without Steam open, starts running Steam
end if
Log in to comment