I try to implement a folder action with Automator. So i use the module "folder action" and there defining the folder. The only action module in there is "Execute AppleScript" with this code inside:
on run {input, parameters}
set fileName to name of (item 1 of input)
display dialog fileName
end run
I simply want to know, if the file dropped into the folder will be transfered!
No dialog is showing up!
The workflow is connected to the folder, because when i insert an action module like "Delete file" it works!
Is there a permission problem?
I tried now the following (without Automator):
on adding folder items to this_folder after receiving these_items
display dialog (item 1 of these_items) as text
end adding folder items to
This works fine and shows me that the binding to my folder works and these_items will be passed as a text to the dialog!
But this does not work!?:
on adding folder items to this_folder after receiving these_items
tell application "Finder"
set fileName to name of (item 1 of input)
display dialog fileName
end tell
end adding folder items to
Strange: I tried with Automator again:
on run {input, parameters}
tell application "Finder"
set fileName to name of (item 1 of input)
end tell
display dialog fileName
end run
and it WORKS!
What is the difference to the example directly with an AppleScript as above?
Ah, i made a mistake! it should be "these_items" not "input"! Both versions work! Thank you all!