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.

Featured Replies

I have several scripts that open certain database tables in a new window for users. I name these windows "$TableName" & ":" & "$RecordName" for usability. Unfortunately, I have another script that relies on the fact that each window has a unique name, but this is obviously not the case. Is there any way I can get a unique ID or something for the window, rather than referring to it by its name?

 

I know there is a Get (WindowName), but is there something equivalent to what a Get(WindowID) function would do? Is there a way I can use Get (UUID) here?

 

Let me know if more information is required. Thanks.

There isn't a function like you're looking for. You could possibly name your window with a Get ( UUID ) function, perhaps on a second line after the table and record, but I don't know how that would work on Windows.

 

Do you ever need two windows with the same name or is that a fluke? Probably better would be to ensure that each window name is unique. When you script starts, have it check the list of open windows and close it or rename it if it's going to be the same name as the new one.

  • Author

Creating windows with the same names is not a fluke; when a user opens the same table (say, "Table1") on the same record (say, "Record_0001") in a new window twice, I get two "Table1 : Record_0001" windows. I'd like to name the windows to describe the window content, so some might be the same.

 

My solution was to just tack on a Get(UUID) to the end of the name, so the name is unique, but still descriptive to the user. It's not the cleanest solution, but it works. I was just hoping I could somehow "hide" the ugly UUID from the user so it wouldn't become confusing. If that's not possible, that's okay.

 

I tried giving the window a List as a name, including the table and record name as one element, then the UUID as the second. Unfortunately, the UUID still shows up on the window title.

 

I am wondering, though, how filemaker itself differentiates windows with the same name? There must be some sort of unique window id somewhere.

"I am wondering, though, how filemaker itself differentiates windows with the same name? There must be some sort of unique window id somewhere."

 

What makes you think that? What operations does FileMaker perform that require it to identify a particular window?

  • Author

Well, I guess it just seems odd that these unique objects do not have unique identifiers. But I guess it only cares about a window that is selected.

 

Interestingly, there is a Select Window[name] script command. When names are not unique, this script step just seems to select the topmost window with the matching name. So maybe Filemaker doesn't care about unique names at all? That just seems odd.

"I am wondering, though, how filemaker itself differentiates windows with the same name? There must be some sort of unique window id somewhere."

 

If a window "Contacts" is open already, then you open another window with the same name, FM will add a number identifier to the new window (i.e. "Contacts - 2").  I don't believe it's possible to have windows with exactly the same name open at the same time.

  • Author

"I am wondering, though, how filemaker itself differentiates windows with the same name? There must be some sort of unique window id somewhere."

 

If a window "Contacts" is open already, then you open another window with the same name, FM will add a number identifier to the new window (i.e. "Contacts - 2").  I don't believe it's possible to have windows with exactly the same name open at the same time.

It is possible if you use a script to create new windows. There is a "New Window" script step that allows one to enter a name for the window. If plaintext or certain variables are used in the file name and the script is run more than once, you can have windows with the same name.

 

This must just be something that was overlooked, as it is not relevant in most contexts. Unfortunately, my problem requires unique window names. I did find a workaround, albeit a messy one.

Wouldn't it make more sense to check to see if that window already exists, and if it does, bring it to the front rather than open a second window of the same thing?  Unless there's a reason why someone would want two of those open.

 

You could do this with Select Window[Name] and Error Capture.  Set the error as a variable and then If [ get(LastError)] = 0 the window is already present.

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.