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.

Window Specific Variable

Featured Replies

I'd like to have a variable that is specific to a window.

A global variable or a global window is not exactly I want, as I may have more than one window (of the same type) open at the same time, each one showing a different set of records (pertaining to THAT window variable).

Any suggestions?

Thanks,

Michael

You might try creating global script variables that are keyed to different windows by a naming convention. (This requires that you make sure that no two windows have the same name.)

If you have two windows named "Contacts" and "Phone Numbers" you could have two global variables named

$$specialVar_Contacts

$$specialVar_PhoneNumbers

Clever use of Execute() along with text filtering and substitute functions can allow you to read and assign to these variables programmatically from the window name. This could be useful if you don't want to have a lot of If/ElseIf statements in your script.

As part of your new windows action, you may be able to set the variable name as the window name using the evaluate. Something like:

Set Variable [ $setvar; Evaluate ( "Let ( $$" & TrimAll ( Get ( WindowName );1 ;3 ) & "="SomeText" " & "; "" )" ) ]

Yes indeed. I do mean Evaluate().

Thank you for catching that.

I think I would prefer something simpler, even if less generic - otherwise you'll be evaluating all day long (since the variable's name is unknown in advance, you'll need Evaluate() to retrieve the stored value, too).

Of course, if the windows are opened and named by script, this would be trivial. Otherwise, you could use the window's name suffix as the variable's repetition.

This is an example file of creating a unique window name via a script and assigning to a uniquely named global (from the window name).

There are two concerns dealt with. (1) Making sure window name is unique. (2) Making sure variable filename is valid by sanitizing the window name and that uniqueness is still preserved after modifying the name.

The calc for converting a window name to the global variable name can be made into a custom function for ease of use, but I didn't do that here to broaden the compatibility.

OneGlobalPerWindow_fp7.zip

  • Author

Thanks for everyone input and help.

I was considering using the window name as the variable.

What I am trying to do is have 8 different layouts (4 list, 4 detail) display 4 different kind of job_items. So as the user clicks on a different tab, he/she will see the different kinds of job_items for that job, depending on which layout he/she is in.

It can easily be done using the window title. I was just wondering if anyone has a better suggestion.

Thanks a lot,

Michael

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.