This file contains 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
on getFrontAppPath() | |
set frontAppPath to (path to frontmost application) as text | |
set myPath to (path to me) as text | |
if frontAppPath is myPath then | |
try | |
tell application "Finder" to set bundleID to id of file myPath | |
tell application "System Events" to set visible of (first process whose bundle identifier is bundleID) to false | |
-- we need to delay because it takes time for the process to hide |