Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Export Field Contents using Set Variable

Featured Replies

Apologies - this was originally inadvertently posted in FMP8 General discussion

I was thrilled to find the Set Variable script step, and I'm trying to use it with Export Field Contents to build simple web sites - I build the contents of an html file in a calculation field then export that field for each record in a looping script. All files are created as expected.

My problem is as follows:

The exported HTML looks and loads fine in a browser window except that (for some reason) the reference to my style sheet does not work. (It does find an img tag reference.) If I paste the contents of the field into a new (BBEdit) text file and save it to the same location, the same style sheet reference does work.

I know at first glance it looks as though I've got the path to the style sheet wrong, but that idea's negated by the fact that pasting the field contents into BBEdit works.

Intriguing: If I try to open the file exported from FMP8 in DreamWeaver, I get a totally blank document, however DW is perfectly happy with the file taken through BBEdit.

Any insights/suggestions?

TIA

Edited by Guest
deleted second post

I'm having a somewhat similar problem with Export Field Contents. What I see when I open the text file in BBEdit is that it is encoded UTF-16. It works for some things. But it is not working for what I wanted to use it for, which is HTML with a lot of JavaScript intermingled. I find the same thing, that copy/paste to a file works fine. I tried xml/xsl export, that that took out the line breaks. What I ended up doing was using AppleScript and the do shell script command to create a file from the field. That works fine, and is pretty simple, though not cross-platform.

set theSites to POSIX path of (path to sites folder)

set theFile to theSites & "web page.html"

--tell application "FileMaker Pro Advanced"

copy cell "_cgHTML" of current record to exportMe

do shell script "echo -n " & quoted form of exportMe & " > " & theFile

-- -n prevents a final line feed from being added (not that it matters in this case)

--end tell

  • Author

Thanks, Fenton. At least I know I'm not alone! As a totally unsatisfactory workaround I've embedded the style sheet.

I've had minimal experience with AppleScript and FMP but will give it a shot when I have the time. In this instance, platform is not an issue - this is for my use only.

Thanks again.

  • Author

Further...

Having blithely uploaded my files, when I take a look at them from the server the file doesn't display properly at all. It shows two characters:

chars1.gif

immediately before the /p>

Opening the file in BBEdit using Unicode 16 encoding after a hint from Fenton shows (here at 96 point)???

chars.gif

If I open the file in BBEdit using Unicode 8 encoding I see this as the first two characters:

chars8.gif

Deleting those two chars and uploading results in:

chars8serv.gif

Now I'm getting worried.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.