Playing Your Game From A Text Editor

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 8: Line 8:
 
Enter this into the AppleScript editor, save it whatever mode your text editor supports (probably 'script'), and place it in a location where your text editor will be able to find it.
 
Enter this into the AppleScript editor, save it 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.
+
For example, with [http://www.barebones.com/products/bbedit/ 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 [http://www.barebones.com/products/textwrangler/ TextWrangler] editor, providing you substitute 'TextWrangler' for 'BBEdit' in the above path.

Revision as of 18:07, 27 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:

<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 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