Hi All,
Can I preform a do script command in a FMP database using a FilePath to it.
ex. of my failed attempt:
tell application “FileMaker Pro”
tell Database “Macintosh:Applications:MyFolder:MyFile.fp7”
do script myScript
end tell
end tell
Thanks in advance!
Hi,
if the file is not opened:
-- edit variable path2file & theFMScriptName according your needs...
set path2file to ("/Users/clemhoff/Documents/~Projects/file.fp7" as POSIX file) as alias
set theFMScriptName to "myFileMakerScript"
tell application "FileMaker Pro" -- "FileMaker Pro Advanced"
activate
try
open path2file
do script FileMaker script theFMScriptName
--do script FileMaker script ID 1 -- performing a script by it's ID number is a better alternative
on error e
display dialog e
end try
end tell
or if it is
set my dbname to "MyDBfileName"
set theFMScriptName to "myFileMakerScript"
tell application "FileMaker Pro" -- "FileMaker Pro Advanced"
tell database dbname
try
do script FileMaker script theFMScriptName
--do script FileMaker script ID 1
on error e
display dialog e
end try
end tell
end tell
Clemoff,
Thanks for your reply.
That worked perfectly.
Can the FileMaker script result be returned by applescript?
Thank
Vincent
Unfortunately no.
The AS command "do script Filemaker script "just triggers the FM script and passes immediately to the next instruction regardless of the FileMaker script’s duration.
You can put the result in a global field or write to a file and then AppleScript
will have access to it.
Cheers,
Craig