MACSCRPT Archives

July 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Joe Barwell <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 11 Jul 2006 15:27:39 +1200
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
On 11/07/2006, at 1:48 PM, Mark Lively wrote:

> What I usually do for something like this is I set up a fileMaker 
> script to export to a set file.  I usually use /tmp or /users/shared.  
> Then I move it/rename it where I want it from there.
>
> What you are encountering here is Filemaker not returning to smile 
> until the export is done.
>
> The Following worked for me.
>
> tell application "FileMaker Developer"
> 	activate
> 	ignoring application responses  --FMP doesn't return until the export 
> is done
> 		do menu menu item "Export Records…" of menu "File"
> 	end ignoring
> end tell
> with timeout of 5 seconds
> 	tell application "System Events"
> 		delay 1  --pause for the dialog to show up
> 		tell process "FileMaker Developer"  --Which app gets the text
> 			keystroke "o" -- just a test
> 		end tell
> 	end tell
> end timeout
>

Hello Mark,

What I find is that FMP will not even activate, once one of the 
relevant dialogs are open (either the "Export Records" or "Specify 
Fields" dialogs). That prevents me from manually setting up one of 
those two dialog windows in advance, in order to do scripting 
experiments--i.e. it would appear I will have to UI-script the whole 
process from start to finish. Where I'm currently stuck is with 
selecting buttons on the dialog windows (i.e. working with the default 
"Untitled.tab" export file):

I can get around it on the first window by instead using 'keystroke 
return', but would have preferred to be able to click the "Save" 
button, as then I might try to use some of the other buttons.

tell application "FMP6"
	activate
	ignoring application responses -- FMP doesn't return until the export 
is done
		do menu menu item "Export Records…" of menu "File"
	end ignoring
end tell
with timeout of 15 seconds
	try
		tell application "System Events"
			delay 1 -- pause for the dialog to show up
			tell process "FMP6"
				-- click button "Save" of window "Export Records to File" -- fails
				keystroke return
				delay 1 -- pause for the dialog to show up
				click button "Clear All" of window "Specify Field Order for Export" 
-- also fails
				--keystroke "o" -- just a test
			end tell
		end tell
	on error e number n
		return e & space & n
	end try
end timeout

The button-clicking attempts generate: 
"NSReceiverEvaluationScriptError: 4 1"

Any suggestions?

Cheers!

Joe

ATOM RSS1 RSS2