In fact there is an other instruction which you encapsulated in a tell Finder block when my original cose was not doing that.
It’s in the handler writeto.
If FileMaker is odd enough to be unable to treat read and write without the tell Finder block, may you try to code :
tell application “Finder”
tell me to set leTexte to read file theMainFile from beg for 100000000
end tell
and in the handler :
tell application “Finder”
tell me to write theData to openFile starting at eof as dataType
end tell
Here is why I urge you to do that.
If I run the script :
set theFile to (path to desktop as text) & "permissions.rtf"
tell application "Finder"
read file theFile
end tell
the events log display :
tell current application
path to desktop as text
end tell
tell application "Finder"
read file "SSD 500:Users:yvankoenig:Desktop:permissions.rtf"
end tell
tell current application
read file "SSD 500:Users:yvankoenig:Desktop:permissions.rtf"
end tell
Yes, the instruction is called twice because the attempt to ask the Finder to execute it fails silently.
I I code the clean way :
set theFile to (path to desktop as text) & "permissions.rtf"
tell application "Finder"
tell me to read file theFile
end tell
the events log display :
tell current application
path to desktop as text
read file "SSD 500:Users:yvankoenig:Desktop:permissions.rtf"
end tell
As you see, here, the Finder is not involved and we don’t have the odd double call.
Of course,
set theFile to (path to desktop as text) & "permissions.rtf"
tell me to read file theFile
or
set theFile to (path to desktop as text) & "permissions.rtf"
read file theFile
behave the same clean way but as FileMaker is an ass it seems that you can’t use these clean syntax.
Please, let me know if the proposed syntax is accepted by the ass and more, if the script object o is also accepted.
Using this script object is a well known tip used to fasten the treatment of lists.
Yvan KOENIG running Yosemite 10.10.4 (VALLAURIS, France) jeudi 16 juillet 2015 11:05:26