Re: Applescript in FMPro
Re: Applescript in FMPro
- Subject: Re: Applescript in FMPro
- From: Shane Stanley <email@hidden>
- Date: Tue, 18 Jun 2013 18:15:16 +1000
On 18/06/2013, at 5:51 PM, John Mitchell <email@hidden> wrote:
> set memberList to (read FileRef as {text} using delimiter {fileDelimiterCR, fileDelimiterLF})
The problem is that read is used as part of FileMaker's terminology, meaning there's a conflict with the read command. So you need to put the read command in another app's tell block; the Finder, System Events, whatever.
You need to put all the file references to that file within the same app's tell block(s), but in this case you don't need file refs anyway: just use read alone, and it does the open/read/close for you. I'm not sure why you're opening with write permission.
And the using delimiters parameter is generally much slower than just asking for the paragraphs of the result. The { and } around the text parameter are unneeded; you're just making extra work for you and AS. So something like:
try
tell application "Finder"
set memberList to paragraphs of (read file filePath)
end tell
on error
...
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden