1

I'm sure this is simple enough to most, but I am just starting to play around with Apple script.

I simply want to have a destination folder highlighted in finder and run a script that will copy all my photo and video files from an inserted SD card to that highlighted folder.

Basically just a quick way to offload files since I do this frequently.

Could anybody help get me started? Any info would be appreciated.

Thanks!

2
  • If you must use Apple's tools, I'd recommend starting with Automator instead of AppleScript. I have almost no experience with Automator, but with some help I got from @Mockman in this Q&A I was able to build a couple of working apps. One of the keys for me was using Automator to handle the GUI stuff, and connecting that to shell scripts I wrote. Maybe this would work for you as well? Commented Apr 6, 2024 at 6:43
  • IOW - maybe if you can get Automator to control the Photo Importer described in the answer below? Commented Apr 6, 2024 at 6:45

1 Answer 1

1

Prebuilt Shortcut

Apple's Shortcuts application includes a prebuilt Photo Importer with Redundant Copy shortcut. The shortcut's description reads:

Copy a folder of content (like photos from an SD card) to your device, rename the folder using a custom prefix you choose, make a backup copy, and notify you when it’s done

Screenshot of macOS Shortcuts

This might be an easier starting point for automating the task.

Scripted Triggering

Assuming a shortcut is called say-hello

The macOS command line tool /usr/bin/shortcuts can run the shortcut with:

shortcuts say-hello 

Alternatively, an AppleScript can use the invisible Shortcut Events application with:

tell application "Shortcuts Events" run shortcut "say-hello" end tell 
2
  • That does sound like a good option. The reason I'm trying to do it with a script is so I can assign it to one of my touch-screen buttons on a Loupedeck. The backup also isn't needed. Commented Apr 5, 2024 at 22:58
  • The answer has been updated to show how a Shortcut can be integrated with a shell script or AppleScript. Hope this helps. Commented Apr 6, 2024 at 8:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.