• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting FileMaker
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting FileMaker


  • Subject: Re: Scripting FileMaker
  • From: "Gary (Lists)" <email@hidden>
  • Date: Sun, 14 Aug 2005 05:26:12 -0400

"Greg" wrote:

>
> I've written a script that work fine and compiles in Smile and ScriptEditor,
> but FileMaker Developer 7 won't compile it (shows an error).
>
> It chokes on
>
> set fileContent to read alias filePath
>
> Is there something different about how FM handles AS? I'm pasting my working
> script into a FM script step named "Perform AppleScript" and then into a
> window with button "Native AppleScript" clicked.

Greg,

There's nothing different about FM and AS, however you must keep in mind
that your script code, once inside that FM script field, is inside an
implicit "tell block".

Your script, that you've pasted, is really being run like this:

tell application "FileMaker Pro"

-- your script

end tell


That means that you have to specifically target applications which might
have a command or property name conflict with FileMaker.

In this case, I think you're hitting such a conflict.  It's probably 'read',
from Standard Additions (base AppleScript) conflicting with 'read' which is
defined in the FM dictionary (it's one of a number of possible values for a
property called 'access', which is a property of many kinds of FM objects.)


Replace your single error-prone line with one of:

tell application "Finder" to set fileContent to read alias filePath

  or

tell application "System Events" to set fileContent to read alias filePath

  and see if that helps. (I think it will. He said...)


On the topic of developing FM-housed AppleScript, obviously knowing this
means that you should just develop your scripts inside that same block, then
remove it if you prefer when you move the script to FM.


HANDY NOTE: I use Smile, which has a feature where you can "target" an
application for a whole script window, so you can just type single line
commands, like:

cell "Some Cell" of current record

...without any tell wrapper at all while you test out your script.

Hope that helps,
--
Gary

 _______________________________________________
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

References: 
 >Scripting FileMaker (From: Greg <email@hidden>)

  • Prev by Date: Re: Getting source text of a compiled script
  • Next by Date: bug? selection of document 2 of Illustrator CS2
  • Previous by thread: Scripting FileMaker
  • Next by thread: bug? selection of document 2 of Illustrator CS2
  • Index(es):
    • Date
    • Thread