StarCraft half-screen script?

Ok, I am new here, and I’m not exactly the best at AppleScript, so lauph at me all you would like.

Alright, I have a video game called StarCraft. (It’s an old game by Blizzard; the people who made World of Warcraft)
In this video game, you are able to toggle the window from full-screen to half-screen. (Command + M)
But now, it appears to not be able to do that anymore, because of an update causing it to have full focus of the keyboard. (Can’t switch windows, because alt+tab does not work)

Now, I am a little fluent with AppleScript, and have learned that you can make hotkeys to execute specific commands. So, I figured, I’ll just write a simple AppleScript that will press the hotkeys to minimize from full-screen to half-screen. (Command + M)

So here is what I have so far. (Note, when I start the game, it will make a dialog popup asking options. To continue to the game, I just press “OK”, keystroke “Enter”, as shown in the image below)
http://img487.imageshack.us/img487/3929/picture1wy7.png

tell application "Starcraft (Carbon)"
	activate
end tell

keystroke "enter"
keystroke "command"
keystroke "M"

I think you can guess what I am trying to do. Just tell StarCraft to start up and tell it to hit “Enter” or “OK” for me when the startup options popup (the image) and then keystroke the combination Command+M, causing it to go into half screen.

Can someone “debug” this script for me?
By the way, I’m running Mac OSX 10.4.8 on an MacBook (Intel Mac)

Thanks.

I do not have that game but you can try this:

tell application "Starcraft (Carbon)"
	activate
end tell
tell application "System Events"
tell process "Starcraft (Carbon)"
	keystroke return
	keystroke "M" using command down
end tell

You will have to check “Enable access for assistive devices” in Universal Access of System Preferences

Hi game_on,

To laugh at others, is to laugh at yourself.

Kel, date “Sunday, December 31, 2006 6:27:16
PM” :slight_smile: