Is there some way to jump to the middle of a “repeat with” block?
Maybe something like:
repeat with aFile in FileList starting at x
On a loosely related matter, can anyone recommend a good AppleScript book? Especially one that will explain how to interpret AppleScript Dictionary syntax; that stuff makes zero sense to me no matter how many times I read it. I end up guessing and reading error messages until I figure out how it works.
Thanks in advance!
PS: What happened to the FAQ area that used to be here?
set letters to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"}
display dialog "How far in should we start? (From 1 to 11)" default answer ""
set startPoint to text returned of result
repeat with i from startPoint to 11
display dialog (item i of letters)
end repeat
In that list of books mentioned above, you will find Hanaan Rosenthal’s AppleScript - A Complete Gude to Scripting and Automation on Mac OS X. I am still utilizing the first edition (published in 2004) - but it is without a doubt my AppleScript bible.
Using that with the information you can garner from this site. You can be up and running in no time.
Having never read Nueburg’s book - I cannot attest to your claim. However, I can tell you that there is no way I am sitting down and reading any of these books cover to cover… and that probably includes the bible! So, in my hands all of the books are reference books.
Hanaan’s book gives you great coverage of all the basics and more advanced topics. As I recall, the coverage of dictionaries is rather basic. Matt Neuberg’s book is quite excellent, but I think it is much more useful for more experienced programmers as it devotes a lot of coverage to more advanced topics. Matt’s book does contain a real life example of learing the scripting model of an application from scratch and the most revealing insight I derived from this was that even for someone who knows Applescript inside and out, using the dictionary is a “hit and miss” proposition and relies a LOT on trial and error. (sad but true)
An even better investment might be using Script Debugger as that gives you a nice look at the dictionary, PLUS it lets you use the “Explorer” mode to see what all the applescript terms in the dictionary are returning. Even cooler, you can drag and drop stuff from the dictionary explorer window right into your script. This feature alone is worth the price. http://www.latenightsw.com/