Re: question about iPhoto scripting
Re: question about iPhoto scripting
- Subject: Re: question about iPhoto scripting
- From: Jonathan E Brassow <email@hidden>
- Date: Mon, 7 Mar 2005 15:18:54 -0600
Hurray!
Goto "System Preferences". Under "System", click on "Universal
Access". At the bottom, make sure "Enable access for assistive
devices" is checked.
Now, when I count the windows of process "iPhoto", I get 1 (or 2 if
"Export Photos" window is open).
I found this out when looking at the example script
"/Library/Scripts/UI Element Scripts/Probe Window.applescript".
I tried the original script on my iBook, and it successfully detected
the "Export Photos" window and set the appropriate fields. It bombed
out when the next window popped up, but I'm sure I can figure out the
problem when I get home and work on my iMac, which has all the proper
directories, etc set up.
Again, thanks for all the help,
brassow
P.S. I'm using Mac OS X 10.3.8
On Mar 7, 2005, at 2:24 PM, kai wrote:
On Mon, 7 Mar 2005 10:43:05 -0600, Jonathan E Brassow wrote:
On Mar 5, 2005, at 12:52 PM, kai wrote:
Some brief additional questions:
1) Given your results above, can I assume that the following line
returns a zero?
----------------
tell application "System Events" to tell process "iPhoto" to count
windows
----------------
Yes, count is zero. It is also zero for other open applications with
visible windows, like: Safari, mail, terminal, etc.
Bummer. Seems it's more likely to be a system/System Events issue,
then.
2) With the "Export Photos" window open, what happens when you run
this line?
----------------
tell application "System Events" to properties of process "iPhoto"'s
window -1
----------------
System Events got an error: NSReceiverEvaluationScriptError: 4
Right. Not too surprising, I suppose - given the above belief that
there are no windows from which to get any properties...
3) With the "Export Photos" window closed - and then open, what
happens when you run this next line?
----------------
tell application "System Events" to enabled of menu item "iPhoto" of
menu "Window" of menu bar 1 of process "iPhoto"
----------------
System Events got an error: NSReceiverEvaluationScriptError: 4
I get that too - but I wanted to make sure it wasn't just my machine.
(My reason for checking this was that some menu items become disabled
when the "Export Photos" window opens - thus offering a potential
alternative check for the presence of the window. Ho hum...) Since the
enabled property is returned correctly from a 'properties' request,
I'd guess this is a bug - which may have already been fixed in later
versions.
4) Exactly which version of iPhoto are you running? (See menu:
'iPhoto/About iPhoto'.)
It turns out, I only have iPhoto 2.0.1... I had been keeping my
system
up-to-date, but had not been paying to upgrade. Sorry, I think I
misled you by accident in my first message.
No sweat - easily done, Jonathan. :-)
I'm not sure what version my iMac has, but I bought it in Nov/Dec.
If you bought it new, that should make it a fairly recent version of
Mac OS X (currently 10.3.x). I'm still on 10.2.8 (much to the
amusement of some, I'm sure) - though I'm expecting to move soon. That
said, it seems from the behaviour you're witnessing that you need to
check your system version. You can do this by selecting the "/About
This Mac" menu option.
While this is an obvious difference you and I have, I'm somewhat
reluctant to point the finger at the version of iPhoto I have - given
that the test script for counting windows does not work for me on
other
applications either.
I agree - for the same reason.
I think what I am going to do at this point is go down to the apple
store and try out some of these scripts on their machines and see what
the output is. I'm virtually certain the original script is
correct...
I just have to figure out what's going on with my machine.
Given that the script is GUI-based (and therefore not exactly my
favourite way to achieve results), the script works remarkably well
here. The odd hiccup when testing on another machine is only to be
expected from time to time, but I'm as disappointed as you must be
that the suggestion fell at the first fence for you.
Thank-you for all the help,
Any time. (I'm sure I needed the practice anyway.) ;-)
Good luck with your investigations...
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden