Для этого с обычными действиями Automator это немного запутанно, поскольку вам нужно сохранить исходный ввод, получить имя, создать папку, вернуть исходный ввод и т. Д. Вы можете использовать Запуск AppleScript действие для выполнения большей части этого за один раз, хотя это зависит от того, что вы хотите сделать с исходным вводом и созданными путями к папкам.
Следующее действие Запуск AppleScript создаст новые папки с именами элементов ввода (обратите внимание, что служба может передавать несколько элементов) и просто передает исходный ввод. Новые папки создаются в той же родительской папке - обработка ошибок (повторяющиеся имена и т. Д.) Не выполняется:
on run {input, parameters} -- make new folders from base file names
set output to {}
repeat with anItem in the input -- step through each item in the input
set anItem to anItem as text
tell application "System Events" to tell disk item anItem
set theContainer to path of container
set {theName, theExtension} to {name, name extension}
end tell
if theExtension is in {missing value, ""} then
set theExtension to ""
else
set theExtension to "." & theExtension
end if
set theName to text 1 thru -((count theExtension) + 1) of theName -- the name part
tell application "Finder"
make new folder at folder theContainer with properties {name:theName}
set end of output to result as alias
end tell
end repeat
return input -- or output
end run