Controlling the "Define Scripts" window in Filemaker

Controlling the “Define Script” window in Filemaker!

Hello to all…

I am trying to change the root of all my “Perform Script” steps in all of my 10,000 scripts in a 60 database solution made in FileMaker. I have developed the next AppleScript to help me out with this problem:

tell application "FileMaker Pro Advanced"
	activate
end tell
delay 1
tell application "System Events"
	tell process "FileMaker Pro"
		keystroke "S" using {command down, shift down}
		delay 1
		if name of window 1 does not start with "Define Scripts" then
			beep
			display dialog "Error"
		else
			keystroke (ASCII character 30) --> up arrow
			keystroke return
			delay 1
			if name of window 1 does not start with "Edit Script" then
				beep
				display dialog "Error"
			else
				keystroke tab
				keystroke tab
				keystroke "Perform Script"
				delay 1
				keystroke space
				delay 1
				if name of window 1 does not start with "\"Specify Script\" Options" then
					keystroke "." using command down
					keystroke return
				else
					tell window 1
						tell pop up button 1
							click
							-- under contruction! 
						end tell
					end tell
				end if
			end if
		end if
	end tell
end tell

Basically the script opens the “Define Script” window, goes to the fist script, looks for the first “perform Script” step in it, it activates it (keystroke Space) and tries to change the First menu. The idea from here would be to change the value of this menu and then select a new script and close the window. Unfortunately the “click” step is not working. I have been incapable of controlling the “popup button” of this window. I have tried in Filemaker 7 to Filemaker 10 and in Mac OX 10.5.6 and 10.4.11. AppleScript version 2.2.1 (100.1), 2.0.1. -but nothing works. ¿ any idea?

Hope someone can help!

Thank you for your time!

Brian

Have you considered using cliclick?

It is a command line utility to perform mouse clicks. What you are attempting to do is not
going to be stable anyway so I would set the windows right were I wanted them and use
clicks to perform the tasks.

Just remember, you cannot move a window and then rerun the script and expect it to work.

To quickly get the coordinates use command, shift + 4 ( to take a screen shot ) and the
coordinates are right there on the mouse pointer.

I know this is not a great solution but it might get you the rest of the way there.

Good luck!

Craig

Thank you Craig for replaying … unfortunately yes I have used Quickeys to click this menu… It works fine. But like you mention stability is very important. Clicking is just half of the battle… I also need to get the value of the pop up menu and the selected script before and after to confirm that the process was done correctly. I am sure There is an answer to this! perhaps FileMaker in Windows, this will be my next experiment I will post my experience once I have tried it :slight_smile: