Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fridzema/60d6851ca8ed9b7333f62a0527f02aa4 to your computer and use it in GitHub Desktop.
Save fridzema/60d6851ca8ed9b7333f62a0527f02aa4 to your computer and use it in GitHub Desktop.
try
set theDestinationFolder to ((path to documents folder) as text) & "database_dumps" as alias
on error -- the folder doesn't exist
return beep 3
end try
tell application "Mail"
activate
set theMessages to selection
tell application "System Events" to tell process "Mail"
click menu item "Save Attachments…" of menu 1 of menu bar item "File" of menu bar 1
repeat until sheet 1 of window 1 exists
end repeat
keystroke "o" using {shift down, command down}
keystroke "database_dumps"
click button "Save" of sheet 1 of window 1
end tell
do shell script "/Users/rf/workspace/import.sh"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment