Jump to content
Sign in to follow this  
Emma in England

Set field with name from Variable

Recommended Posts

I have several fields which get acted on by very similar scripts, with small differences. So I'm trying to make the script as multi-purpose as possible so when I improve it I can just copy it and tweak a couple of lines.

So, among other things, I want it to read the text in the field into a variable, perform a calculation (to strip out unwanted tabs etc) and replace the text.

I have:

Set Variable[$TextToProcess;Value:Get(ActiveFieldContents)]

I would like to then do:

Set Variable[$CurrentField;Value:Get(ActiveFieldName)]

and then

set field $currentField .... to the result of my calculation.

But I can't see any way to put a calculation or variable into the 'set field' (I mean the name of the field, not what to put in it).

Hope I've explained myself clearly, it doesn't look like it to me...

Share this post

Link to post
Share on other sites

That's great! You don't even have to 'name' the object. Just saying

Go to Object[ObjectName: $FieldToProcess]

took me to the correct field without fiddling about assigning names via the objects pallette.

My related scripts are brilliant now - only 2 lines different in each one (where the variables are assigned) which makes improving them so much easier.


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

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