When something unexpected happens, a plugin function returns a result of "ERROR"
. This makes it easy to check for errors.
If a plugin function returns "ERROR", call the ScribeLastError
function to get a detailed description of what went wrong.
Here is an example of basic error reporting:
Set Variable [ $result = MyPluginFunction("x" ; "y" ; "z") ] If [ $result = "ERROR" ] Show Custom Dialog [ "An error occurred: " & ScribeLastError ] End If
Since the string "ERROR"
evaluates to false when evaluated by FileMaker, and most plugin functions return a 1
when successful, you can chain multiple dependent plugin operations together using the "and"
operator.
However, in this case the result will be a 1
or a 0
, not "ERROR"
. For example:
// chain multiple calls together
// if any of the functions fail, the calculation will
// short-circuit with a result of false
,
// and none of the subsequent function calls will be evaluated.
Set Variable [ $success =
FirstPluginFunction("x") and
SecondPluginFunction("y") and
ThirdPluginFunction("z")
]
If [not $success]
Show Custom Dialog [ "An error occurred: " & ScribeLastError ]
End If
Note: the above only works for plugin functions which return 1
on success! Check the documentation for each function used in this manner.
If a plugin is not installed correctly, calls to a plugin function will return "?". As part of your startup script, you should check for this occurrence and display a warning accordingly that the plugin needs to be installed. Note: when treated as a boolean true/false value, FileMaker will treat ?
as true
.
FileMaker version 7 or higher.
Java Virtual Machine (JVM) version 1.5 or later (32-bit). If you are running a JVM earlier than 1.5, you should upgrade.
Download a JVM from http://www.java.com/en/download/. If you are not sure what
version of Java you have installed, you can do java -version
on the command line in Windows or OS X.
Windows, or Mac OS X version 10.4 or higher.
Note to intel Mac users: running this plugin under Rosetta is not supported. Upgrade to FileMaker 8.5 to run our plugin in native Intel mode.
Drag the plugin from the MAC or WIN folder into your FileMaker extensions, and restart FileMaker.
If the plugin does not load correctly, double-check that you meet the system requirements.
You do not need to do this step unless you plan on using the plugin with Instant Web Publishing or Custom Web Publishing with FileMaker Server Advanced. You will need an Enterprise License to use this feature.
For installing into the Web Publishing Engine with FileMaker Server or FileMaker Server Advanced, drag the plugin from the MAC (.fmplugin file) or WIN (.fmx file) folder
into the FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins
folder. If there is no Plugins
folder inside the wpc
folder, then create it manually.
Restart FileMaker Web Publishing, and now the plugins should be ready to go.
Note that due to a bug which we and other plugin vendors have reported to FileMaker, web plugins do not work in FileMaker Web Publishing Engine 8.0v4 on Mac OS X. You will need to use a later version, like 9, or an earlier version, like 8.0v3. The Windows FileMaker Server 8.0v4 does not have this bug, and will work correctly.
The easiest way to test whether the plugin is working is to have a calculation which calls the version function of the plugin, and display that on an IWP layout. If it shows "?", then the plugin is not working. If it shows a number, then the plugin has been installed successfully.
You do not need to do this step unless you plan on using the plugin with scheduled script triggering, a new feature in FileMaker Server 9. You will need an Enterprise License to use this feature.
/Library/FileMaker Server/Database Server/Extensions
folder.
On Windows, this is at C:\Program Files\FileMaker\FileMaker Server\Database Server\Extensions
.Configuration -> Database Server->Server Plug-ins
and check the box that says 'Enable FileMaker Server to use plug-ins', and then check the 'enabled' box for this plugin.
Click the 'save' button and wait a few seconds to make sure that the 'enabled' check box stays checked. If it does not, then there was an error loading the plugin and you should contact us for help troubleshooting.
You should now be able to write schedules that trigger scripts which use the plugin.360Works has created an AutoUpdate helper database which makes setting up Auto Update much easier. This file includes pre-configured plugin files which you can place on your server, and an auto-update script for each of our plugins which you can paste into your own solution.
You can get the AutoUpdate360Works file at fmp7://autoupdate.360works.com/AutoUpdate360Works. Follow the instructions included in the file to either host your own Auto Update server or pull the files from ours.
Plugins will run in demo mode until they are registered. While running in Demo mode, the product will run for 2 hours every time you launch FileMaker / FileMaker Server / FileMaker Web Publishing Engine. The 2 hour time limit will reset every time you relaunch FileMaker. There is no expiration date when Demo mode stops working. There are no feature differences between the Demo version and the licensed version.
Once you have purchased the plugin, you can register it with the license key. Once a valid license key is entered, the product will run for as long as FileMaker is running. After FileMaker starts up with the plugin installed, open FileMaker preferences, click on the Plug-ins tab, select the plugin from the list, and click the Configure button. Enter your license key and company name in this dialog. You will only need to do this once on a given machine. Alternately, you can use the registration function to register the plugin during a startup script.
Note that if you are running the plugin with FileMaker Server / FileMaker Web Publishing Engine, you must use the registration function to register the plugin, since there is no preferences dialog on FileMaker Server to enter the license key and company name.
We love to hear your suggestions for improving our products! If you are experiencing problems with this plugin, or have a feature request, or are happy with it, we'd appreciate hearing about it. Send us a message on our website, or email us!
searchString
with replaceString
in the currently loaded document.file
.file
.highlightPattern
in text
.For example, the following report:
additions: 2 214 modifications: 0 0 deletions: 1 47Indicates that:
someText
- initial textotherText
- modified text
verbose=true
" as a custom option to cause modifications to be displayed as a delete then an insert, instead of a modification.
someText
- intial textotherText
- revised textoptions
- optionsScribeDoc*
functions.
containerOrUrl
- container, path (including File URLs), or URL for the file being loaded.args
- optional arguments.tag name
of the Content Control Field as the parameter. Content control fields can only be
created on Office 2007 on Windows, but can be read and written on both Windows and Mac. More information about how to make content control fields can be found here.
A5
".
To specify a sheet other than the first sheet, include the sheet name followed by an exclamation point, e.g. "Sheet 2!BB42
".
name
- attribute name to read.The newName parameter tells Scribe what to name the container field value. This can take two forms:
The optional flatten parameter can be used with PDF forms to save a "flattened" version of the form, this would make the form fields unenterable.
For example, if you've done a find and replace operation on a Word document and would like to store it into a container field called 'ResultContainer' while retaining the original filename, you would do it this way:
Set Field[ ResultContainer; ScribeDocSaveContainer("") ]
The path parameter tells Scribe where to save the file to. This can take several forms:
The optional flatten parameter can be used with PDF forms to save a "flattened" version of the form, this would make the form fields unenterable.
searchString
with replaceString
in the currently loaded document.
Note that searchString
and replaceString
should generally should be short pieces of text,
which only span one line (for convenience... long search strings can be more complicated to correctly enter into FileMaker calculations).
This feature is only available for Microsoft Word 2007 and later (docx format). Carriage returns are ignored by this function.
To replace named form fields or cells in a PDF form, Word Document, or other file, use the ScribeDocWriteValue function instead.
To use this, you must first load a document using ScribeDocLoad.
ScribeDocSubstitute
one or more times, save the modified file using ScribeDocSaveFile.
If you need to substitute many different text occurrences, just call this function once for each term that you want to find and replace.
searchString
- text to findreplaceString
- text to replace searchString
withTo use this, you must first load a document using ScribeDocLoad.
tag name
of the Content Control Field as the first parameter. Content control fields can only be
created on Office 2007 on Windows, but can be read and written on both Windows and Mac. More information about how to make content control fields can be found here.
To do a find/replace operation on text in a word document, use the ScribeDocSubstitute function.
A5
" as the first parameter.
To specify a sheet other than the first sheet, include the sheet name followed by an exclamation point, e.g. "Sheet 2!BB42
".
Writing a value to a non-exisent sheet will generate an error. If you specify a non-existent cell or row, it will be created.
ScribeDocWriteValue
one or more times, save the modified file using ScribeDocSaveFile.
name
- field / cell to write tofmValue
- data to writefile
.
Unlike ScribeFileAsText, this only returns unique names, and strips out common "stop words" like "a", "and", "the", etc.
This can reduce storage requirements if you are performing text searches against the contents of files, but don't need the extracted text to be human-readable.
file
- file or container field to extract index fromfile
.
For binary file document formats such as Word, PDF, etc. this attempts to return a human-readable presentation of the document. XML documents are returned as-is. Any unrecognized file will have its raw text contents returned (see optional parameters to customize this).
You can pass in optional additional parameters to customize the behavior of this function. A list of customizations follows:
Here is a list of supported file types for reading text from:
file
- file or container field to extract text fromhighlightPattern
in text
.
Unlike the substitute
function, this is case-insensitive by default.
The highlightPattern function supports regular expression patterns.
Using the flags
optional parameter, you may set the following options, each of which influences the way patterns are matched.
Example of a highlight operation to match the string "file://" at the beginning of each line of a return-separated list.
Set Field [ Globals::highlighted_text = ScribeHighlight( "file://temp/doc.txt" & ¶ & "file://documents/doc.txt" & ¶ & "http://my.site.com/home" & ¶ & "ftp://my.ftpsite.com/upload" ; "^file://" ; "flags=multiline" ) ]This matches "file://temp/doc.txt" & ¶ & "file://documents/doc.txt"
colorRGB
, styles
, and size
.
Consult the Filemaker TextStyleAdd
and TextColor
documentation for more details about named Filemaker text styles and colors.
Example of a highlight operation to make any occurrences of "atlanta" blue and bold (the default highlight style is bold, blue text):
Set Field [ Globals::highlighted_text = ScribeHighlight(Documents::body ; "atlanta") ]Example of a highlight operation to highlight runs of 1 or more sequential numbers as green italic text:
Set Field [ Globals::highlighted_text = ScribeHighlight( Documents::body ; "[0-9]+" ; "colorRGB=" & RGB(0;255;0) ; "styles=" + Italic" ) ]
text
- The input texthighlightPattern
- the word or regular expression pattern to highlightadditionalParameters
- Additional parameters are specified using a name=value syntax. The parameters colorRGB
, size
and styles
control the look of the replaced text. The parameter flags
controls the way in which pattern matching is performed.highlightPattern
highlighted with the current styles.
""
if there was no error.
Example of a function to extract a return-separated list of numbers from a string.
ScribePatternMatchAll("123 and 5321 are open, but 0121 is closed" ; "[0-9]+") /* returns the following: 123 5321 0121 */
flags
optional parameter, you may set the following options, each of which influences the way patterns are matched.
ScribePatternMatchAll( "Wilhelm¶wilson¶Williams¶Zander" ; "wil.*" ; "flags=includeLineEndings+caseInsensitive" ) ScribePatternMatchAll( "Wilhelm¶wilson¶Williams¶Zander" ; "wil.*" )
text
- input textregex
- regular expression pattern.flags
- An additional parameter used to specify flags that control how pattern matching is performed. To specify multiple flags, separate each with a plus sign (e.g., ..."flags=literal+ignoreWhitespace")
Highlighting style is determined by the three optional parameters: colorRGB
, styles
, and size
.
Consult the Filemaker TextStyleAdd
and TextColor
documentation for more details about named Filemaker text styles and colors.
Using the flags
optional parameter, you may set the following options, each of which influences the way patterns are matched.
Example of simple replace, converting two or more consecutive line breaks to a single line break:
ScribePatternReplaceAll( "Line one¶Line Two¶¶¶Line Three¶Line Four" ; "\n+" ; "\n" ) // returns "Line one¶Line Two¶Line Three¶Line Four"
Example of a highlighting replace operation, highlighting the literal string "quick" by using styles:
ScribePatternReplaceAll("The quick brown fox" ;
"quick" ;
"quick" ;
"colorRGB=" & RGB(128 ; 128 ; 255) ;
"styles=" + Bold
)
// returns The quick brown fox
text
- The input textregex
- The regular expressionreplacement
- The text to replace the found occurrences with. This may contain backreferences.additionalParameters
- Additional parameters are specified using a name=value syntax. The parameters colorRGB
, size
and styles
control the look of the replaced text. The parameter flags
controls the way in which pattern matching is performed.regex
replaced with replacement
licenseKey
- a valid license keyregisteredTo
- the company the plugin is registered to"ERROR"
on failure.
This will affect all calls to ScribeDifferencesBetween until you quit FileMaker.
The available styles are:
color
- a FileMaker RGB value (such as 'rgb(255,0,0)' for red) or HTML-style hex value (such as "#FF0000" for red)styles
- Any of the Filemaker style keywords, or -1 to hide text of this type in the diff result.open
- An optional text string appended before an additionclose
- An optional text string appended after an additionThis will affect all calls to ScribeDifferencesBetween until you quit FileMaker.
color
- a FileMaker RGB value (such as 'rgb(255,0,0)' for red) or HTML-style hex value (such as "#FF0000" for red)styles
- Any of the Filemaker style keywords, or -1 to hide text of this type in the diff result.open
- An optional text string appended before a deletionclose
- An optional text string appended after a deletionThis will affect all calls to ScribeDifferencesBetween until you quit FileMaker.
color
- a FileMaker RGB value (such as 'rgb(255,0,0)' for red) or HTML-style hex value (such as "#FF0000" for red)styles
- Any of the Filemaker style keywords, or -1 to hide text of this type in the diff result.open
- An optional text string appended before a modificationclose
- An optional text string appended after a modification