AnsweredAssumed Answered

Script importing URL and more from Safari?

Question asked by deaconmac on Oct 25, 2017

It's been years since I've done any scripting in FMP but I have recently converted an older database to run under FMP 14 and later (on a Mac). The conversion went fine, but one of my scripts is no longer working and I'm stumped. It's a simple script designed to grab the URL and Title of the currently active webpage in Safari and add it to the corresponding fields in a new record in FMP.


After specifying browse mode and layout and opening a new record, there's an AppleScript as follows:


tell application "Safari"

    set currentDocument to document of window 1

    set currentURL to URL of currentDocument

    set currentTitle to name of currentDocument

tell application "FileMaker Pro"

    set cell "URL" of current record to currentURL

    set cell "Page Title" of current record to currentTitle

  end tell

end tell


This used to work fine in earlier versions of FMP, but it's failing with these error messages in 14:


Screen Shot 2017-10-25 at 10.01.08 AM.png


Screen Shot 2017-10-25 at 10.01.25 AM.png


There are no other users, no other active scripts running as far as I can find. Any ideas?