En script Editor.app , pegue lo siguiente AppleScript en un nuevo documento, y luego nombrarlo y guardarlo como un archivo "scpt" en /Users/ TU_NOMBRE_CORTO /Library/Workflows/Applications/Folder Actions.
No sé cuál es tu "código shell de trabajo", así que he utilizado el código para cambiar las etiquetas de las carpetas en el Finder como ejemplo
on adding folder items to theFolder after receiving theNewItems
-- Called after items have been added to a folder
--
-- theFolder is a reference to the modified folder
-- theNewItems is a list of references to the items added to the folder
tell application "Finder" to set label index of theFolder to 3
end adding folder items to
on removing folder items from theFolder after losing removedItemNames
-- Called after items have been removed from a folder
--
-- theFolder is a reference to the modified folder
-- removedItemNames is a list of names of items removed from the folder
tell application "Finder"
set theCount to count of items of entire contents of theFolder
if theCount = 0 then
set label index of theFolder to 0
end if
end tell
end removing folder items from
Una vez que este código se ha ajustado a su gusto, y se ha guardado en la carpeta mencionada anteriormente, estará disponible para su uso dentro del Carpeta Acciones Setup.app para adjuntar a cualquier carpeta de su elección.
FYI : Estos son todos sus Carpeta Acción opciones que puede utilizar con su AppleScripts
on adding folder items to theFolder after receiving theNewItems
-- Called after items have been added to a folder
-- theFolder is a reference to the modified folder
-- theNewItems is a list of references to the items added to the folder
-- your code goes here
end adding folder items to
on removing folder items from theFolder after losing removedItemNames
-- Called after items have been removed from a folder
-- theFolder is a reference to the modified folder
-- removedItemNames is a list of names of items removed from the folder
-- your code goes here
end removing folder items from
on closing folder window for theFolder
-- Called when a folder's window is closed in the Finder
-- theFolder is a reference to the closed folder
-- your code goes here
end closing folder window for
on moving folder window for theFolder from previousBounds
-- Called when a folder's Finder window has been moved or resized
-- theFolder is a reference to the folder being altered
-- previousBounds is old position and size of the folder's Finder window
-- your code goes here
end moving folder window for
0 votos
No estoy convencido de que sea posible. ¿Puedes explicar un poco más tu flujo de trabajo? Tal vez haya otra forma de hacerlo.