Hi all,
Spent some time late this arvo trying to figure this one out, but
couldn't find a decent explanation. I have been tinkering around with
Applescript (Script Editor 1.7, on OSX 10.1.4, Pismo 500, 384Meg),
trying to write some rather simple code. Ran into a number of different
problems, but the one which was most unusual was the inability of the
script editor to record scripts. At its very basic, I tried the
following:
1) clicked "record" in the script editor
2) switched to desktop by clicking on it
3) created a new folder
4) clicked back to the script editor
5) clicked "stop"
Result: nothing listed in the script window!
What's up with that?
Things worth mentioning:
1)The finder dictionary is listed amongst those apps in script editor
which are scriptable.
2)This behaviour was replicated on an Imac DV 400 and a TiBook, all of
which run OSX installed from the same cd.
3) I downloaded and installed the latest applescript (1.8.2b3) with no
improvement. NB: the script editor still lists as version 1.7 after
upgrading.
4) When I boot into OS9 on the Imac and record the above listed actions,
the script records no problem.
5) Running a manually entered script to create a new desktop folder
achieves the desired result in OSX.
6) If I click record, launch ITunes (from dock or by doubleclicking
app), click stop, nothing is recorded. However, quiting ITunes will be
recorded.
Can anyone shed some light on this? Everything I came across on the web
suggests Applescript is fully functional in OSX. Have I missed
something?
Also, does someone know how to list the frontmost application in
Applescript? I have tried the following without success:
return name of current application
return name of frontmost application
The closest I have come is to get a list of all open (non-hidden)
applications using:
tell application "Finder"
return name of every process whose visible is true
end tell
TIA, Matt.
----------------------------------------
Matt Huitson
Dept. of Psychology
University of Western Australia
Nedlands, WA 6097
Western Australia
work: 61 89 380 3639
mob: 0414 294 770