Thank you for posting.
I cannot replicate this issue, except if one or both fields are not included on the layout where the script is executed.
Please note that most of Edit steps require an enterable focused field's object on layout where they are performed.
Behind this, Copy and Paste steps are supposed to be similar to their related menu command.
You can modify your script by doing directly a Set Field, thus bypassing the system clipboard :
Set Field [Global::CopyPasteTest2; Global::CopyPasteTest1]
Fred, many thanks for the correction. Having programmed for many years in conventional languages, I sometimes overlook the significance of layouts in FM scripts.
The reason the FMPA 11 test doesn't fail is that it's a one-off ad hoc file with a default layout which includes those two fields. The FMPA 12 test was part of a much larger system, and in the layout effective when the script was running, those two fields were missing.
Concerning your suggestion to bypass the system clipboard, I actually need to use it. The real purpose for using Paste is to obtain a file path copied to the clipboard by this AppleScript script:
"set the clipboard to (choose folder with prompt "Choose a folder") asstring"
If FMP had a Choose Folder script step, I wouldn't have to use AppleScript's choose folder, but I sure haven't found one.
AppleScript can set a value in a Filemaker Field so are you sure you need to use the clipboard?
Thanks for the question, Phil. The clipboard is eliminated in this script:tell application \"FileMaker Pro Advanced\"¶set data field \"Global::folderPath\" to (choose folder with prompt \"" & $prompt & "\") as string¶end tell--Ham