|
|
Pass arguments and run GUI AppleScripts via cron
First, notice that the original poster used
"$@" (in quotes). That is subtly different than the simplistic $* that you suggest. The difference is that shell will correctly process complex arguments if necessary (eg, if one or more arguments passed has spaces in it as in the original poster's test example).
Second, the original script outputs a single line for each (quoted) argument.
Third, the applescript extracts the arguments by using The original solution is therefore much more flexible and rubust and it's also less error prone than your "optimized" solution, which will fail at unexpected times. Shell programming can be simple, but there are many subtle complexities, which aren't really for the faint of heart.
Pass arguments and run GUI AppleScripts via cron
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:
Also since the 4 second sleep is only necessary if the file existed before then
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. --- |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.43 seconds |
|