Re: Bring FileMaker window to front
Re: Bring FileMaker window to front
- Subject: Re: Bring FileMaker window to front
- From: Chris Garaffa <email@hidden>
- Date: Sat, 6 Dec 2003 20:25:34 -0500
On Dec 6, 2003, at 7:48 PM, Bill Briggs wrote:
At 7:18 PM -0500 06/12/03, Chris Garaffa wrote:
So my question is, how do I activate a window in FileMaker Pro (6.0
v1)?
I ran into this back in February doing a scripting job for a client.
IIRC FileMaker Pro 6 can't tell it's databases apart when you address
them from a script. I remember that it was very perplexing at the time
- took me a while to figure out that it was FileMaker Pro and not the
script that was messing up. It should be enough that you name the
database, whether it's frontmost or not. I expect that the desired
database won't activate because the activate message is going to the
wrong database in the first place. What happened to me was exactly the
same as what happened to you - same error message.
Thanks, Bill. At least I know I'm no doing something wrong in my script!
I just solved this by using GUI Scripting. I've removed the "activate"
commands for each database, am now using one tell block for each
database. Before I do anything to the databases, I do something like
this:
changeFMWindow("Data.fp5")
where changeFMWindow is defined as:
on changeFMWindow(theDatabase)
try
tell application "System Events"
tell process "FileMaker Pro"
tell window theDatabase
perform action "AXRaise"
end tell
end tell
end tell
on error
display dialog "The requested window probably doesn't exits."
end error
end changeFMWindow
To clarify, the script now looks like this:
tell application "iTunes"
--set a bunch of variables
end tell
changeFMWindow("Album")
tell application "FileMaker Pro"
tell database "Album"
--do stuff
end tell
end tell
changeFMWindow("Data.fp5")
tell application "FileMaker Pro"
tell database "Data.fp5"
--do more stuff
end tell
end tell
Hopefully this will help someone in the future!
--
Chris Garaffa
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.