Playing Your Game From A Text Editor

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
 
When you're working in your text editor, it can be a nuisance to have to manually switch back to Unity to test your game.  This AppleScript will automatically bring Unity to the front and press Command-P to start the game:
 
When you're working in your text editor, it can be a nuisance to have to manually switch back to Unity to test your game.  This AppleScript will automatically bring Unity to the front and press Command-P to start the game:
  
 +
==AppleScript - Play In Unity.scpt==
 
<boo>tell application "System Events"
 
<boo>tell application "System Events"
 
tell application "Unity" to activate
 
tell application "Unity" to activate

Revision as of 20:45, 29 December 2005

When you're working in your text editor, it can be a nuisance to have to manually switch back to Unity to test your game. This AppleScript will automatically bring Unity to the front and press Command-P to start the game:

AppleScript - Play In Unity.scpt

<boo>tell application "System Events" tell application "Unity" to activate keystroke "p" using command down end tell</boo>

Enter this into the AppleScript editor, save it in whatever mode your text editor supports (probably 'script'), and place it in a location where your text editor will be able to find it.

For example, with BBEdit, save the script in ~/Library/Application Support/BBEdit/Scripts/. Once you've done that, you can assign a keystroke to launch it using the Scripts Palette. This also works for the free TextWrangler editor, providing you substitute 'TextWrangler' for 'BBEdit' in the above path.

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox