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.

Passing script parameters with newlines (or unquoting Quote())

Featured Replies

We have a function that takes multiple script parameters in order to send an email.

 

(we do this because we need to check for a maintenance variable which governs who gets the email)

 

I am sending parameters as newlines and using (Get(ScriptParameter);1) to retrieve them.

 

Works great unless a parameter as a newline, like the body of an email does quite often.

 

I can use Quote(text) to get it into the function properly but once its there I cant unescape the newlines to get them into the email properly.

 

Does anyone have a tip on how to either pass parameters that accept newlines or to undo Quote once it arrives (just for newlines if thats easier).

 

I tried Substitute(text) without any luck.

 

Tx!

John-

Get(ScriptParameter) does not allow breaking down the parameter; it collects the entire parameter that was passed.  You must parse it after you retrieve it:

 

Set Variable[$ScrptParam; Get(ScriptParameter)]  // the quote function is not necessary!

Set Variable[$FirstParam; GetValue($ScrptParam; 1)]  //  first line in parameter

//etc

 

I'm not clear about what the newlines in the parameter are doing in the script, so if the above doesn't work, give us a more detailed description of what you are trying to accomplish.

You can use Evaluate ( GetValue ( Get ( ScriptParameter ) ; 1 ) ) to unquote the Quote()d parameter. Can I convince you to use a name-value script parameter structure? Most of the techniques out there for it will handle this kind of thing for you.

Is there a reason why you can't start your script by loading each value into its own individual variable? That would not only eliminate the need for parsing, but also retain the values' data types (not to mention the added clarity by having a meaningful name for each value).

 

 

 

 

I tried Substitute(text) without any luck.

 

Well, if the script parameter is =

Substitute ( text ; ¶ ; "§" )

then =

Substitute ( Get (ScriptParameter) ; "§" ; ¶ )

will retrieve the original text.

I agree with Mr. Bante, name/value pairs are where it's at. I use a somewhat simpler routine that consists of only one custom function to parse out the parameter -- I don't use a function to send the parameter.

 

Mr. Comment, good to see you again!

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.