Found this forum after deciding to have a crack at learning Applescript for the first time.
I’m not a 'coder" in any way shape or form, though I have built a few web sites using the most basic html.
So that’s who I am . . . . now what I’m “trying” to do:
Firstly I’m trying to learn, so I’d be keen to know if there’s a good book anyone could recommend, I’ve had a go at an online tutorial, and thought I’d understood to some extent . . . so I’ve been working through what I need to do in small steps.
For my first project, I’d like to be able to open a “Toast Titanium” template file which I currently have on my desktop, this I’ve called “Test” for the time being, so I tried this code to launch it:
tell application “Finder”
set Test to selection
I also saw the following which I thought may also work, but haven’t inserted the file name “Test” yet!
tell application “yourApp”
set theFile to
. . . . . so the first code didn’t work, in one attempt, I thought I saw Toast load, but then it disappeared.
Keen to understand what’s happening here, so if anyone cares to help, I’d very much appreciate their time.
selection is always a list, if you want to process only one item, you have to specify the item.
And you have to coerce it to a string path or an alias, because most other applications can’t handle Finder file specifiers
Toast is scriptable, so use it
tell application "Finder"
set Test to item 1 of (get selection) as alias
tell application "Toast Titanium"
I have a very old version of Toast (V 7.1.3), maybe the newer versions work different
For resources and books I’ve used Danny Goodman’s Applescript Handbook (I got the electronic version, but the hardcopy is still floating around on Amazon I think). The company seems to be out of business, but the book’s still valuable (ie, no updates to my electronic version are available…rats!) The electronic version is a pdf and it’s got html style links and whatnot so it’s easier than some manuals I come across to navigate. Good examples throughout and I find the writing very ‘english’ and not ‘programmese’. I actually worked my way thru the first couple chapters when I was starting as they were that good I felt. It also comes/came with a large number of example scripts you can play around with.
I don’t see it available online as a pdf/electronic download and since the company is kaputt, I suppose that means I could share it with you…perhaps that’s not ok or against the rules of the forum…not sure…can anyone chime in on that? Don’t want to be the bad guy here, dontcha know!
I’ve also downloaded and used the Applescript Language Guide and the Applescript Additions Scripting Guide…not as good as the other but free.
And of course I’ve used this website extensively. Often I will download scripts not because they are what I need but to look under the hood and see what the language looks like in use in the real world…I’ve learned a lot that way. I save the tidbits of script that seem common and useful so that I can easily grab them and drop them into a script I’m monkeying around with.
Cheers and good luck with it!
Many thanks for the corrections to my first attempt . . . I was quite pleased with myself when it “appeared” to work, but quite deflated when I came back to it the next day and it didn’t! But hey, thats how we learn eh? Still not quite familiar with the “Se;lection” part of your comment, but will read up on that later!
So I’ll give that a go when I get home this evening, and (a great tip from “emjayel”) save it to my “Tidbits” folder (about to be created!)
Will post back regardless, to let you know how I got on!
I’d be very interested in the eBook, and if it doesn’t contravene any forum rules, I’d be happy for you to email the link to me, or post it here on the forum for others to use!
Thanks for the insight guys, I think this is going to be a steep learning curve, but it look fascinating, and the end result I’m trying to achieve will be quite a complex piece of work.
Maybe once I get the first steps up and running, I’ll post to see if the whole “project” is do-able!
Look forward to hearing back form anyone else who has a comment to make!
You can’t post the ebook itself on the forum, but you can definitely include a link to a copy or source in a post. I got my copy many years ago from SpiderWorks, but they’re no longer in operation. Google is your friend too.
Thanks for the prompt clarification, sir!
Hi again guys,
(sorry still a newbie)
I’m finally able to copy my external drive’s files into Toast, & bring up a window which requests “Insert a Blank Writable DVD”, but then after clicking the “OK” button in this window, the burn window appears . . . . but no actual burn takes place???
What am I doing wrong?
Any/all help gratefully received.
set thefile to alias "mytoastprojectfile.disk"
set file_to_add to "mymoviefile.MPG" as alias
tell application "Toast 10 Titanium"
set toast_project to current disc
add to toast_project items file_to_add
display dialog "Please insert a blank, writable DVD."
ignoring application responses
write current disc without asking
Thanks in advance.