Created
August 2, 2014 16:44
-
-
Save n8henrie/0ceef75964bd153f910d to your computer and use it in GitHub Desktop.
Uses a hacky workaroud to duplicate the frontmost Finder tab, since Apple hasn't provided great AppleScript support for this.
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
-- duplicateFinderTab.scpt | |
-- Uses a hacky workaroud to duplicate the frontmost Finder tab, | |
-- since Apple hasn't provided great AppleScript support for this. | |
-- Details at: | |
on new_tab() | |
tell application "System Events" to tell application process "Finder" | |
set frontmost to true | |
tell front menu bar to tell menu "File" to tell menu item "New Tab" | |
perform action "AXPress" | |
end tell | |
end tell | |
end new_tab | |
on run {} | |
tell application "Finder" | |
if (count of Finder windows) > 0 then set duplicate_me to target of front Finder window | |
end tell | |
delay 0.5 | |
new_tab() | |
tell application "Finder" | |
set target of front Finder window to duplicate_me | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment