This may be mentioned somewhere, but thought I’d throw it out for all who need it.
I’ve managed to build a workaround to call os 9 osax commands from an OS X script. There’s one or 2 osax for os 9 we use. We are unsure if they are going to be carbonized or not, but rather than sit with os 9, we are plunging ahead with the switch to OS X. Anyway…
Here’s the quick info: instead of having a script from OS X call an osax command directly, we use an OS X script to call a Classic Applet that calls the OS 9 osax command.
Now the in-depth stuff: We use a script addition called FindFile to search for files of a certain name. First I use Script Editor for 9 to make a script like this:
on findThis(lookHere, nameContents)
set tempFind to FindFile in_folder lookHere name_contains nameContents
return tempFind
end findThis
I save it as a Classic Applet. I also check ‘Never show startup screen’ and ‘Stay Open’.
Then in my OS X script, I can do this:
set findapp to “MyMac:Wherever:findApp”
tell application findapp
run
set temp to findThis(alias “MyMac:Documents:”, “Report”)
quit
end tell
If all goes correctly, the os x script will launch, run the classic applet which in turn runs the commands from the os 9 osax. Finally, it will return the files found. It has worked for us pretty well.
Yes, I know you will need to have Classic installed on your Mac. And I know this isn’t the most effecient way to do this. The most effecient would be to learn C or Obj-C and write my own OS X osax, but since I don’t think will be happening very soon, this will have to do. =D
Please give me some feedback if this works for you or not. Or ways this can be improved.
Thanks!