Re: question about iPhoto scripting
Re: question about iPhoto scripting
- Subject: Re: question about iPhoto scripting
- From: kai <email@hidden>
- Date: Sat, 5 Mar 2005 18:52:33 +0000
On Fri, 4 Mar 2005 23:46:48 -0600, Jonathan E Brassow wrote:
On Mar 4, 2005, at 9:01 PM, kai wrote:
<snip>
With only the main iPhoto window visible, I ran this snippet:
-------------------------
tell application "iPhoto" to set appWin to name of windows
tell application "System Events" to tell process "iPhoto" to set
procWin to name of windows
{appWin:appWin, procWin:procWin}
--> {appWin:{"iPhoto", "Window", "Slideshow", "General", "Window",
"HTMLExport Panel", "Window"}, procWin:{"iPhoto"}}
-------------------------
<snip>
I get:
{appWin :{" iPhoto ", " Window ", " Window ", " HTMLExport Panel ", "
Window "}, procWin :{}}
regardless of whether the "Export Photos" window is open or not.
I've tried using "tell process #", but that doesn't seem to work
either. In fact, it doesn't matter which process I use, procWin
always comes up empty.
I've tried this on my iBook. Haven't tried this test script on my iMac
yet (although the original script failed in the same way). We'll see.
Doesn't look right, does it? And if the original script also failed on
your iMac, my guess is that the behaviour there will be pretty much
similar to that on your iBook. I'm sorry that you're experiencing this
difficulty after I raised your hopes.
Instead of using a checking repeat loop, to allow a process time to
execute a previous statement, some folks simply introduce a delay. I
normally try to avoid that approach - since the execution time can
sometimes vary significantly, depending on what else is going on at the
time. This means that, to avoid a potential error, any delay has to be
more generous than is generally necessary - which in turn slows down
the overall running of the script.
If we can't find some way around this issue, we may have to resort to
introducing a fixed delay. However I'm still a bit concerned that,
since your iPhoto process evidently doesn't register windows, it may
not even have the ability to issue commands to the "Export Photos"
window (on which the rest of the script is somewhat reliant).
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
----------------
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
----------------
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"
----------------
4) Exactly which version of iPhoto are you running? (See menu:
'iPhoto/About iPhoto'.)
---
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