Automator memory leak workaround for multi-file processing
I encountered an issue similar to the one described here: Automator Lag - Apple Community.
I restructured my Automator workflow in a way that I believe avoids a possible memory leak. The workaround is to call an embedded workflow which processes a single file from loop implemented in AppleScript (see example below).
- Pie Lover
AppleScript multi-file loop
on run {input, parameters}
set workflowpath to "/Users/admin/Pictures/Apply sRGB Profile to Images.workflow"
set qtdworkflowpath to quoted form of (POSIX path of workflowpath)
set theseImageFiles to input
repeat with i from 1 to the count of theseImageFiles
set thisImageFile to item i of theseImageFiles
set qtdthisImageFile to quoted form of (POSIX path of thisImageFile)
set command to "/usr/bin/automator -i " & qtdthisImageFile & " " & qtdworkflowpath
set output to do shell script command
end repeat
end run
[Re-Titled by Moderator]
Mac mini (2018)