Skip to content

Instantly share code, notes, and snippets.

@thnk2wn
Last active May 18, 2018 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thnk2wn/0a9f93c64dc99746a457c2ca5e414f07 to your computer and use it in GitHub Desktop.
Save thnk2wn/0a9f93c64dc99746a457c2ca5e414f07 to your computer and use it in GitHub Desktop.
on run {input, parameters}
do shell script "open /Applications/Preview.app"
set importFromPhoneText to "Import from iGeoff"
tell application "System Events" to tell process "Preview"
set frontmost to true
delay 2
click (menu item 1 where its name starts with importFromPhoneText) of menu 1 of menu bar item "File" of menu bar 1
delay 2
click button "Import All" of group 1 of front window
set cameraImportPath to "/Users/hudgeo/Desktop/camera"
#set myPath to choose folder with prompt importFromPhoneText default location POSIX file cameraImportPath
#choose file with prompt "Choose a folder" default location alias myPath
keystroke "g" using {shift down, command down}
keystroke cameraImportPath
delay 1
keystroke return
delay 1
keystroke return
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment