Hello All,
I've written a bash script that renames and copies files from one directory to another using rsync. I'd like to take it a step further and write an AppleScript Folder Action that sees my drive in the /Volumes directory and auto opens Terminal and runs my script (I have some output I want to see which is why I want Terminal to open).
My problem is getting the stupid AppleScript to see my drive. Here's what I've gotten from the Internet and I can't seem to make it work:
I started using Automator and creating the Folder Action and thought that may have been the issue so I then just wrote the AppleScript and applied it to the folder and still nothing. I then just wrote a simple "display notification" line in the "Run AppleScript" module in automator and it worked so I don't think Automator is the issue.
Any help with this would be much appreciated.
Thanks!
I've written a bash script that renames and copies files from one directory to another using rsync. I'd like to take it a step further and write an AppleScript Folder Action that sees my drive in the /Volumes directory and auto opens Terminal and runs my script (I have some output I want to see which is why I want Terminal to open).
My problem is getting the stupid AppleScript to see my drive. Here's what I've gotten from the Internet and I can't seem to make it work:
Code:
on adding folder items to this_folder after receiving these_items
repeat with this_item in these_items
if (current_item as text) contains "USBDRIVE" then
display notification "USBDRIVE is mounted"
end if
end repeat
end adding folder items to
I started using Automator and creating the Folder Action and thought that may have been the issue so I then just wrote the AppleScript and applied it to the folder and still nothing. I then just wrote a simple "display notification" line in the "Run AppleScript" module in automator and it worked so I don't think Automator is the issue.
Any help with this would be much appreciated.
Thanks!