problems with the dictionary

in the 24u appearances scripting additions dictionary, there is this:

basically i have no idea how to implement any of the options given :/, save for the button list, default and cancel button. can anyone help me?

side note, should i buy a book or subscribe to some tutorial to learn applescript properly? so far i’ve got along on learning it myself and stealing, err…borrowing other people’s scripts. any advice?

Model: iBook G4
AppleScript: v2.1 (80)
Browser: Safari v2.0 (412)
Operating System: Mac OS X (10.4)

If you want the full nine yards, try http://www.oreilly.com/catalog/applescpttdg/index.html.

For less money and good coverage (my starting point) try Danny Goodman’s “AppleScript Handbook for OS X”. It’s available as a .pdf download (for $15 or so) at http://www.spiderworks.com/books/ashandbook.php.

I enjoyed both, found both useful.

I don’t have that scripting addition, but it could look something like this:

display alert "Alert text" explanation "More text." buttons {"Stop", "Continue"} default button "Continue" cancel button "Stop" alert type caution movable true help button false

FWIW, I wouldn’t feel too bad about your attempts to translate dictionary entries into something remotely practical.

At best, a dictionary provides only clues about the terms an application will respond to. Finding the correct syntax can still be a real headache, for all but the most experienced scripter - and the absence of examples can leave one well and truly at sea. I’m afraid that some dictionaries can even be totally misleading, by suggesting (say) that an alias is expected - when the app concerned might really require something like a file path…

That said, checking a dictionary is a crucial step in gaining a better understanding of how to approach scripting an application. As things develop, one’s instincts about how to use the information really do improve… :slight_smile:

ok i tried copying that exact same script but the ‘explanation’, ‘alert type’, ‘movable’ and ‘help button’ part still don’t work. this might be stupid but, could it be because i haven’t registered and they locked the commands?

and thanks kai, i was almost at the point of giving up, thinking i would never be an advanced scripter if i couldn’t even get the proper syntax from the dictionary. i shall persevere :slight_smile:

That’s the spirit! I always think of this stuff as something akin to a crossword puzzle. You get a few clues, bang your head against a brick wall a few times - even feel like giving up on it. Then suddenly eureka! - and you’re there! How satisfying is that? :slight_smile:

Snake, I see you have OS X 10.4. In Tiger, Apple added their own display alert command. Your system maybe trying to use that one instead. You can find the new command in the Standard Additions dictionary.

Just out of curiosity, Snake, I downloaded a copy to have a look at it for myself. The commands wouldn’t even compile and, from the behaviour and brief notes I saw, I’d tend to agree that the product is indeed locked - in spite of a comment to the effect that one might be able to use it for a 30-day trial period. I don’t have time right now to look into it more closely but, if you want to pursue this, it looks like you may have to register first… :expressionless:

thanks kai and guardian34, appreciate the help, although i won’t be registering with 24u anytime soon cos i don’t really have that much money to throw around on a hobby :/. i’ll work with what i have instead.

Understood, Snake. :slight_smile:

ok more dictionary problems lol :rolleyes:. it’s to do with 24u appearance again. i don’t think the unregistered version is different from the registered version now that i’ve tinkered around, only that an annoying dialog box pops up every 5 times or so i use it asking me to register. anyway, i was trying to make a progress indicator. i can make one, but i can’t get it to update. here’s the entry:

and here are the properties:

and my script so far:

create progress indicator with properties {minimum:1, maximum:10, current value:1, top message:"top message", bottom message:"bottom message", buttons:{"OK", "Cancel"}}
	repeat with i from 2 to 10
		update progress indicator
		{current value:i}
	end repeat