Software Venture Consulting
ToMarket

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

EncodeURL_CF ( textToCode )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.3  (8 votes)
  Discuss this Custom Function

Paul Spafford, Spafford Data Solutions
http://www.paulspafford.com

Encodes all urls enclosed in square brackets for html.

Sample Input:
EncodeURL_CF ( TextField )

Where TextField contains the following:

FileMaker User and Developer Group of Eastern Ontario:
[http://www.fudgeo.com]

Spafford Data Solutions:
[http://www.paulspafford.com]
Sample Output:
FileMaker User and Developer Group of Eastern Ontario:
<a href="http://www.fudgeo.com">http://www.fudgeo.com</a>

Spafford Data Solutions:
<a href="http://www.paulspafford.com">http://www.paulspafford.com</a>


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

When creating a multi-part email with an email plug-in, you need to encode any links as html, to make sure that more email applications will allow the links to be clickable.

When writing the text for the email, your users just need to enclose each url in square brackets.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

This function doesn't loop if you have more than one link. I propose:

//HTMLurl (text;target)

Let( [ FS=Position(text;"*";1;1) ; SS=Position(text;"*";1;2) ; URL=Middle(text;FS+1;SS-FS-1);

A= Substitute( text; Middle(text;FS;SS-FS+1) ; "<a href='http://"& URL & "' target='_" &target& "'>"& URL &"</a>" ) ];

If( PatternCount ( text ; "*" ) ≥ 2; HTMLurl( A; target ); text)

)

// transforms all text in between 'star' (exemple: *mydomain.com* ) with the URL link. No need to write the http:// first
// target is to choose if you want to open in self ; blank ; top or new window
// by Patryck 2010

Patryck, Barcelona
January 17, 2011 8:51am

This function fails if there's an extra closing bracket. "]".

Eric.Matthews, SJSU.edu
August 12, 2011 11:47am

This fixes infinite recursion from mismatched brackets:

Let ( [
@textToCode = textToCode
; @openSquarePos = Position ( @textToCode ; "[" ; 1 ; 1 )
; @closeSquarePos = Position ( @textToCode ; "]" ; @openSquarePos;1 )
// Search from "@openSquarePos;1" not "1;1" Eric.Matthews sjsu.edu

; @afterOpenSquare = Right ( @textToCode ; Length ( @textToCode ) - @openSquarePos )
; @url = Left ( @afterOpenSquare ; @closeSquarePos - @openSquarePos - 1 )
; @encodedUrl = "<a href=\"" & @url & "\">" & @url & "</a>"
; @subbed = Substitute ( @textToCode ; "[" & @url & "]" ; @encodedUrl )
];

Case
( // @openSquarePos and @closeSquarePos" determine completion. Eric.Matthews sjsu.edu
not(@openSquarePos and @closeSquarePos);
@subbed;
EncodeURL_CF ( @subbed )
) // End Case

) // End Let

Eric.Matthews, SJSU.edu
August 12, 2011 12:20pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 0 + 8 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. phpArrayValue ( array ; key ; pos )
  (Fri, Jan 27, 1:49pm)
2. solfm_timeToMinutes (theTime;roundSec)
  (Fri, Jan 20, 6:26am)
3. filterLines(filterField;filterValue;Result)
  (Sat, Jan 14, 2:20pm)
4. getMaxValue ( theList )
  (Thu, Jan 12, 1:06pm)
5. MiddleWordsIncPunct ( text ; startingWord ; numberOfWords )
  (Sat, Jan 07, 9:16am)
6. WindowInfo
  (Fri, Jan 06, 12:39pm)
7. CenterWindow in Window vert horiz (demension)
  (Fri, Jan 06, 12:25pm)
8. UTF8_to_TXT ( Text , Platform )
  (Wed, Dec 28, 10:44pm)

RSS Feed of Custom Functions