Created
March 7, 2011 22:51
-
-
Save gingerhendrix/859434 to your computer and use it in GitHub Desktop.
Applescript to get the name of the foreground App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set AppleScript's text item delimiters to ":" | |
set front_app to front_app's text items | |
set AppleScript's text item delimiters to {""} --> restore delimiters to default value | |
set item_num to (count of front_app) - 1 | |
--display dialog item_num | |
--display dialog item item_num of front_app | |
set app_name to item item_num of front_app | |
set AppleScript's text item delimiters to "." | |
set app_name to app_name's text items | |
set AppleScript's text item delimiters to {""} --> restore delimiters to default value | |
--display dialog item 1 of app_name | |
set MyApp to item 1 of app_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment