Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'AppleScript better' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
AppleScript better
Authored by: alex_kac on Sep 12, '02 01:13:10PM

Something that I think will be more useful to Mac heads is a FolderAction.

Now I\'m not good at AppleScript, but I know AS can do this natively as well as run shell scripts.

So possible if someone can write an AppleScript, we can attach it to a Folder as a FolderAction and voila.



[ Reply to This | # ]
AppleScript is NOT better
Authored by: viega on Sep 12, '02 02:28:11PM

No, the first thing I did was a folder action. They were too flakey. The actions kept disappearing mysteriously, first of all. Second, you couldn't drag-and-drop the mime-attachment to the folder directly because the mime-attachment was a read-only file. Third, you couldn't set the desktop to have folder actions and have that actually work. Fourth, even if actions worked robustly, while you can add Folder Actions to StartupItems, it was not straightforward to attach the folder action on login automatically. Fifth, Doing the regular expression replaces in AppleScript was going to be really messy, whereas it's simple from a shell script. The shell script also brought the entry up into iCal MUCH faster than the AppleScript solution.



[ Reply to This | # ]
AppleScript better
Authored by: viega on Sep 12, '02 02:33:46PM

By the way, here's the final AppleScript I was using as a folder action. The action disappeared on a fairly regular basis. All this script does is call out to the shell command.

But, if you can get it to work for you, that's great:

property this_command : "/Users/viega/bin/ical_convert"

on adding folder items to this_folder after receiving these_items
try
set this_result to do shell script this_command
on error error_message
display dialog error_message
end try
end adding folder items to



[ Reply to This | # ]