Getting A Variable Into AppleScript With Automator
Then the following AppleScript runs:
property parentFolder : (path to desktop folder)
on run argv
set myList to item 1 of argv
set myFile to myList's item 1
set myMonth to month of (current date)
set currentMonthFolder to myMonth & space & "Announcements" as string
tell application "Finder"
if not (exists folder currentMonthFolder of parentFolder) is true then
make new folder at parentFolder with properties {name:currentMonthFolder}
end if
move myFile to folder currentMonthFolder of parentFolder
end tell
end run
But when running the script does not work as intended. The variable myFile is not getting what it should, so I would like to pass the variable from the previous automator action and do it that way.
This is supposed to take a file named 'ANNOUNCEMENTS_' then add the date and move it to the corresponding announcements folder.
OS X Yosemite (10.10.2), null