Skip to content

Instantly share code, notes, and snippets.

@ucnv
Created August 16, 2010 15:40
Show Gist options
  • Save ucnv/527149 to your computer and use it in GitHub Desktop.
Save ucnv/527149 to your computer and use it in GitHub Desktop.
path = File::expand_path ARGV.shift
scpt = <<SCPT
tell application "Finder"
activate
select POSIX file "#{path}"
end tell
tell application "System Events"
tell process "Finder"
keystroke "y" using {command down, option down}
end tell
end tell
SCPT
system("osascript -e '%s'" % scpt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment