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.

Custom dialog script step not displaying script variables

Featured Replies

Hello:

 I need to get the pixel measurements of a window so I built a script to help:

1.  Set local variables $x, $y, and $title

2.  X gets window width (get function), $y grabs the window height (get function), and $title grabs the current window title

3.  Call the custom dialog which should echo back the variables but doesn’t see attached

F265E0F7-5AF2-43A3-9541-CBBDC17D3D79.thumb.jpeg.bbf32ca145f40e2b824c275b1c4ad724.jpeg
 

as we can see here, the dialogue 

fails to pull in the respective variables… I was thinking to make this a script that way I can set a window to the size I wanted, run the script, get the information and then be able to plug-in the x and Y values when telling a different script step to open a new window. 
 

did I miss something somewhere in the chapter on scripts? If I did, please feel free to correct my ignorance. If you’d like to see a copy of the script self, I can arrange for that

1 hour ago, Carly F. said:

If you’d like to see a copy of the script self, I can arrange for that

Of course we would like to see a printout of your script. Or have another way to reproduce your problem, such as a demo file. Without this, all you can hope for are guesses. My guess would be that the variables' names are placed within the quotes in your formula used to calculate the custom dialog's message - thus being literal text instead of a reference. But I don't like to guess.

 

Edited by comment

  • Author
11 minutes ago, comment said:

Of course we would like to see a printout of your script. Or have another way to reproduce your problem, such as a demo file. Without this, all you can hope for are guesses. My guess would be that the variables' names are placed within the quotes in your formula used to calculate the custom dialog's message - thus being literal text instead of a reference. But I don't like to guess.

 

I think that’s it… I’ll have to get a look at it in the morning as I’m winding down for the night after a long Dev session

as a quick work around, I took literal measurements of the screen in inches, and searched the appropriate conversion from inches to pixels. I still intend to provide the script just to be on the safe side

Edited by Carly F.
Added quick work around for my problem

  • Author
14 hours ago, comment said:

Of course we would like to see a printout of your script. Or have another way to reproduce your problem, such as a demo file. Without this, all you can hope for are guesses. My guess would be that the variables' names are placed within the quotes in your formula used to calculate the custom dialog's message - thus being literal text instead of a reference. But I don't like to guess.

 

Thanks for your help: find attached the FileMaker 12.x file.  Right now it's just filled with testing data so I don't mind sharing this pre-release version.

To access the file use the following developer credentials:

account name: dev

Password: "Make you pay!"

it's important that the password be entered without the quotes, with the spaces, and with all caps an punctuation inside the quotes in tact

In the final version, I intend to have a credits layout to list all the people who helped... so you will be recognized for your help.  Also in the final version I plan to keep the "dev" account in place so if a user forgets their password, they can send  me their file an I can reset it (if that was the only admin user)... still working on getting basic functionality working before I worry too much about polishing it up for end-users

the script in question for this thread is the one called GetWinDims

 

I have some other questions regarding some scripts in this file but let's troubleshoot one problem at a time.

should anyone have any further questions about this please let me know.

thanks for any help and feedback given

Vendor-Experience-v1_Carly_demo.fmp12

Edited by Carly F.
Corrected spelling errors and added version number of file

As I suspected, the formula you used to calculate the custom dialog's message is all a single literal text:

"The active winow has the following properties ¶ Window Name $title ¶Window Width $x ¶ Window Height $y"

You need to change the variables' names to references instead:

"The active winow has the following properties ¶ Window Name " & $title & "¶Window Width " & $x & "¶ Window Height " & $y

or perhaps in a more convenient way:

List (
"The active window has the following properties:" ;
"Window Name: " & $title ;
"Window Width: " & $x ;
"Window Height: " & $y
)


A side note: I could not help noticing that the only thing you're doing with the variables is use them in the custom dialog, and that the active window does not change from the time you set these variables until you use them. In such circumstances, populating the variables accomplishes nothing other than consume some memory. You can easily use the original Get() functions directly in your calculation.

 

  • Author

@commentthanks for your help with this!  For your insight on this (and probably other issues I might have in future… I’ve listed you in the credits as a thanks for the help

The below might look like junk but this is the preliminary credits screen:

 

E3ABDD64-C44A-448F-ACE5-49EBF62F354D.thumb.jpeg.f9b2a24cd93dd4c572f1c95922800349.jpeg

it looks better in person, but I can’t take a screenshot of my remote desktop session on windows and get it to my iPhone without a bunch of headache so, I just point the camera at the laptop screen, take a picture and crop it down to the bit I need. Then I open it up and pinch-to-zoom verify that at least it’s possible to read the text I’m after. 
 

my developer credits are a table so I can  easily add more people who help out.

 

there… as promised in another post, I gave you (and anyone else who will provide help/answers/fixes when I’m stuck) credit as it was your answer that fixed it :) 

 

you, my kind friend should get paid for your knowledge

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.