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

Click here to return to the 'Pass arguments and run GUI AppleScripts via cron' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Pass arguments and run GUI AppleScripts via cron
Authored by: leenoble_uk on Sep 19, '05 02:47:20PM

I'm no Shell guru myself. It took quite a lot of repeated Google searches and misplacing of quotes to reach that end. I was trying to use backslash-n to generate new lines. I used odd sequences of characters as argument delimiters. Apparently you can contract it further by removing the curly braces and writing:


for i in "$@"; do
echo "$i"
done > "$ARGFILE"

Also since the 4 second sleep is only necessary if the file existed before then

if [ -f "$ARGFILE" ]; then
    rm "$ARGFILE"
    sleep 4

will remove the delay. Credit to Mark J Reed on the Applescript Users mailing list for that.

By the way, the Applescript needs to be amended to move the file.
It should read:

move file (actionFile as string) to the trash

So, I said ... well, I can't actually remember exactly what I said. But it was one of the most enormously cruel and frighteningly witty put downs ever.

[ Reply to This | # ]