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.

Getting a cell Value

Featured Replies

I can't find the solution to this anywhere, hopefully you can help.

I'm writing an applescript that controls BBEdit's wonderful find and replace function to modify a link in a web page. The value it modifies is based on a LastName field in a Filemaker database.

Here is the problem:

When I set the variable LastName in Filemaker, BBEdit errors during the replace step. But when I set the variable directly all works fine.

Here is how I set the variable in Filemaker:

tell application "FileMaker Developer"

  tell current record of layout "data_entry_T"

--script doesn't work if setting LastName using Filemaker

	set LastName to cell "Last Name" as string

  end tell

end tell


When I set the variable LastName directly the script works.


set LastName to "Thiessen"


This is the first time I've pulled data from Filemaker using applescript, could it be a text encoding problem? 

I've analyzed the Script Editor Event log and everything appears OK. 

Here is the step BBEdit errors on:


replace LastName using "test" searching in linklist saving yes options s_option


The error from BBedit is:

"BBEdit got an error /Users/mthiesse/desktop/BALOG-BBVWRG-0012379.htm" doesn't understand replace message."

Here is the entire code:


tell application "FileMaker Developer"

	tell current record of layout "data_entry_T"

		set LastName to cell "Last Name up" as string

	end tell

end tell

tell application "BBEdit"

	--script works when I set LastName using line below

	--set LastName to "Balog"

	set linklist to "/Users/mthiesse/desktop/" & LastName & "-" & "BBVWRG" & ".htm"

	set s_option to {search mode:literal, starting at top:true, case sensitive:false, match words:true, extend selection:false, showing results:false}

	replace LastName using "test" searching in linklist saving yes options s_option

end tell

Edited by Guest

I would try this:

Set LastName to cell "Last Name" as text

...instead of string!

--sd

  • Author

Thanks for your advice but changing "as string" to "as text" didn't help. Another interesting thing, you know how the Event Log replaces variables with the real values. I can copy the BBEdit part from the Event Log and paste it into a new ScriptEditor window and it will do the find and replace.

You don't have to use either "as string" or "as text". FileMaker text data is Unicode text, which is new in 7. So you can use "as Unicode text" if you want, but it's not necessary.

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.