![]() |
![]() |
![]() |
Help: AppleScript SnippetsTextExpander 2.0 introduces a new type of snippet -- AppleScript. You can choose "AppleScript" as the format type then enter an AppleScript such as this one: -- add seconds to current date When you enter the abbreviation associated with an AppleScript snippet, the AppleScript will execute and if the snippet has a text result, it will replace the abbreviation. If you'd like to have access to the abbreviation used to trigger the AppleScript snippet, you'll need to write your script as a textexpander handler such as this: on textexpander(days) The script above allows you to set up multiple abbreviations with the same script to get different results. For example, you could use the abbreviations "d+1" and "d+2" to get tomorrow's date and the day after tomorrow. Also, you could use "d-1" for yesterday. AppleScript also offers a "do shell script" command so that you can execute shell scripts or scripts in other scripting languages such as Ruby, PHP, and Perl. For more information on the "do shell script" command, please see Apple's excellent Technical Note 2065: |
||
© 2006-2008 SmileOnMyMac, LLC. All rights reserved. SmileOnMyMac and TextExpander are trademarks of SmileOnMyMac, LLC. |