AppleScript file converter: run Yuzu through Shortcuts
Updated:
Short answer
An AppleScript file converter can use Yuzu Drag through Apple Shortcuts. Yuzu exposes Process Files and Run Preset, not a direct AppleScript conversion dictionary. Create a shortcut, pass files explicitly and call it with the macOS shortcuts command-line tool.
The shortcut owns the file-processing steps and the destination. AppleScript can choose the input and launch that shortcut, which keeps the automation easier to inspect than a series of simulated clicks.
Start with built-in macOS automation
If your task is a simple image conversion or resize, try Shortcuts' built-in image actions first. Create a shortcut with an explicit input, add the native operation, then add a save action. Run it manually and check the result before introducing AppleScript.
AppleScript is useful when it is already part of a larger workflow, or when you want a file chooser before calling an existing shortcut. It is not required merely because you want to process more than one image. A Finder Quick Action may provide the same convenient entry point with less scripting.
For a one-off conversion, opening an image in Preview and exporting it may also be enough. Choose a workflow that matches how often you run the task, rather than adding scripting as a prerequisite to doing a simple export.
What Yuzu actually exposes
Yuzu's Process Files action offers Convert to JPEG, Convert to PNG, Convert to WebP, and Resize image. It accepts files and returns output files to the next Shortcuts action. Run Preset accepts a compatible saved local transform or image chain and returns its results in the same file-oriented way.
These are App Intents available to Shortcuts, not a direct AppleScript object model. A script cannot assume that the wheel labels are scripting verbs or that a saved preset's display name is a command parameter understood by Yuzu itself.
Run Preset excludes configurations requiring interaction, sharing, mutation, or clipboard access. If a preset needs an options sheet or a destination picker at runtime, it is not suitable for this headless path. See the Shortcuts reference for the parameters and Finder setup.
Create the shortcut before the script
Build and save a shortcut named Prepare image. The name is an example you create yourself, not a shortcut preinstalled by Yuzu.
- Add a file-input path in Shortcuts, using Shortcut Input for the processing action's Files parameter.
- Add Yuzu Drag's Process Files action.
- Select Convert to PNG for an initial test.
- Add a save action receiving the returned files.
- Configure an explicit test destination and any overwrite behavior in that save action.
- Run the shortcut manually with a suitable local image and inspect the saved result.
You can later replace the processing action with Run Preset if you have a compatible saved recipe. Keep the initial version small enough that you can identify whether a failure comes from input, processing, or saving.
Invoke the configured shortcut from AppleScript
Once Prepare image exists and works manually, this script chooses one file and passes its path to the shortcut:
set sourceFile to choose file with prompt "Choose an image to process"
set shortcutName to "Prepare image"
set sourcePath to POSIX path of sourceFile
set runCommand to "/usr/bin/shortcuts run " & quoted form of shortcutName & " --input-path " & quoted form of sourcePath
do shell script runCommand
The quoting is important. A Finder path or shortcut name can contain spaces, and building shell arguments by simple concatenation can change their meaning. quoted form of passes the name and path as individual shell arguments rather than treating their characters as shell syntax.
This script intentionally does not guess your destination or parse a returned path. The shortcut's save action decides where to place the output. Check that saved file directly. If you change the shortcut name, change shortcutName to match it exactly.
Access and troubleshooting
A script, Shortcuts, and the processing app can encounter macOS access prompts. Approve the files and destination you intended to use. A script running from a different host app may encounter different authorization context from a shortcut you ran manually.
If the command cannot find the shortcut, check its saved name and availability in Shortcuts. If no file reaches Yuzu, inspect the Files connection. If processing finishes but nothing appears in your intended folder, inspect the save action. Do not replace these checks with interface-clicking delays.
The shortcut does not automatically inherit Finder's current selection when launched this way. This example supplies one chosen file explicitly. A batch workflow must supply its intended batch through an appropriate input setup; do not assume that opening Finder and selecting files changes the command's input.
Keep the manual workflow separate
For manual use, drag an image, tap ⇧ for Convert or ⌘ for Tools, then drop on a wedge. Another ⌘ tap opens Actions. These gestures are useful for direct work, but they are not a scripting interface and do not need to be reproduced in an automated workflow.
The image tools hub describes supported processing tasks, and the preset reference explains reusable configurations. Keep originals until you have inspected the saved output and confirmed that the surrounding automation uses the result you intended.
Related links
FAQ
Can I tell Yuzu Drag to convert a file directly?
There is no shipped direct AppleScript conversion dictionary in the current app source. Use its Shortcuts actions and invoke the configured shortcut instead.
Does an AppleScript need to simulate dragging?
No. Build a shortcut using Process Files or a compatible Run Preset action, pass files explicitly, and invoke that shortcut from the script.







