Help a Beginner Access Dictionaries

I’m missing something really basic and really obvious. I’m writing a script that uses the keyword “track” of the iTunes dictionay AND the keyword “tab” of the Safari dictionary.

If I select iTunes from the second pulldown menu of the AppleScript Editor, the script runs but the keyword tab seems to be ignored. If i select Safari from the pulldown, the compiler complains about the keyword “track” from the iTunes section.

I guess I need to know how to “include” both dictionaries. When i put “say (scripting components) as text” at the top of my code it just says “AppleScript” and nothing else. I’m just a really confused beginner and would like for one or two of your most excelentness scripting wizards to enlighten me here, thanks a bunch!

Hi. “Tab” is an AS constant that can be used anywhere. “Track” is not in the Safari dictionary, so you can’t really include that word in a tell block to Safari, unless you use iTunes’ terms, but I’m not sure that’s appropriate for what you’re actually doing. It would be helpful if you post your sample code, so that someone can suggest a solution.

Well, i guess let me ask another question, specificlly this code:

tell application browserApp to close tab with visible

does not close the visible tab of Safari’s window. How do I do that? Thanks in advance!

Welcome to the forum.

Try:

tell application "Safari" to close current tab of front window

Thanks for the welcome and for the solution, it works now!

Even though i am obviously a newbie beginner to AppleScript, I’m actually an experienced scripter working on something that is like wow man, like amazing or so we believe. The incredible power of AppleScript is making it possible to prototype some ideas rapidly and effectively. I might suggest at some point getting a more experienced scripter/OSA/VBA type person involved but for now we can only offer ownership if anything, but i ramble and will stop now.

Anyway, thanks a bunch! MacScripter rocks!

AppleScript as a prototyping tool! I’m curious! Tell me more, please (possibly with some sample code, in Code Exchange).

Prototype as in to show a client or internally a working solution without the fancy interface, high performance and expensive development time. That’s why we’re using AppleScript (Studio in the past) too, to show possibilities. When you’ve become to an agreement after it went through a process of discussions and (a lot of) changes, you start writing it over in a more sophisticated language.

Deviating slightly. Prototyping being the common denominator. I have come by NoSQL lately, and it is cool to simulate database transactions with: April 2007 Linux Productivity Magazine: NoSQL: The Unix Database (With awk) ( I don’t recommend installing anything, just get the principles, and use the tools you already have on your machine.)

This kind of prototyping is more of help for the programmer alone, and not in collaboration with the user, but never say never. At least this very simple prototyping technique can give you a fast hands on on your table design, and provide a very fast and easy way to test your data-model.