Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 8185 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have set up a script to zoom my window to the apporpriate size and set in my preferences for this script to run on opening the file. It is not working. I can run the script manually and it works fine, but not on open. Any ideas. I want my windows to be sized correctly all the time.

Posted

I duplicated this setup in a test file, and it works the same on startup and manual execution. I find the Toggle Window command to be more of a sizing thing than a zoom. But if it does what you want it to manually but not at startup, then there could be other things happening at startup that hinder it. Are other related files opening?

Ken

Posted

Ah, that might be the problem. Make an external script in your opening file that calls the toggle script. Add a halt step to end the script in the toggling file.

If I remember correctly, you have to end your toggling in the file you want to toggle or else the main file comes back up. But I can't remember exactly. Perhaps someone else could shine some light.

Ken

PS, how far away do you live from the River Walk? I went to AIT at Ft. Sam Houston. Oh, nostalgia. I remember shooting fireworks out of the car window on the 4th of July while on our way to Corpus Christi. I was so drunk that we stopped off the side of the road next to Lackland AFB so I could pee in this deep storm drain. the wall was so steep I lost my balance and fell into the nasty gutter and got all wet. - just one of many memories I'd soon forget.

Posted

I have several related files that contain buttons that take user to this partacular (File A) file. Those buttons trigger the external (file A) script which zooms and halts as you suggested. It works fine there. But if I simply open the file by itself the "upon openingl, run x script" preference for that same script doesn't work.

Posted

Sorry, man. Don't know what to tell ya. Once again I created a test setup with 2 files: TestOpen is a file that performs a script that opens TestToggle (the toggle file) and performs the external zoom toggle. When I open TestOpen it opens TestToggle and toggles it just as desired. I even put the toggle script at startup of TestToggle, opened it solo and it resized as desired. Sorry that I cannot duplicate the problem.

The only pointers I can give at this point are:

-You don't need to script the opening of files if they are related - they will open the moment they are needed

-If you are moving from one file to another, you only need to call the external script to maximize the other file; you won't need the halt step. The halt was only for startup.

I can send you the test setup I made - it's simplistic, but maybe you can tell me if I know what youre talkin about.

Ken

Posted

The Toggle Window [Zoom] command is highly context dependent. To get a predictable result using it, it should be preceded by a number of other steps which establish the 'environment' on which it will act.

From what I've read in this post, it is possible that the problem stems from the fact that the pre-existing window conditions (layout, status bar, magnification level etc) are different when you are calling the script manually, from when the script runs at file open.

I suggest you try adding the following steps before the Toggle Window [Zoom] command in your open script:

Enter Browse Mode

Go to Layout ["layout you want the 'zoom' resize to operate on"]

Set zoom level [100%]

Toggle Status Bar [Hide] ( or Show - according to your preference)


If context is the source of the problem, this will correct it. If not, at least it will eliminate it as a possibility...

Posted

Sup Ray:

Originally I was going to suggest Set Zoom Level also, but Mike said that the Toggle Window was what he was looking for to resize, not zoom.

Additionally, I like to use a script that zooms depending on the desktop resolution:

If [status(CurrentScreenHeight) = 768]

Set Zoom Level [Zoom Out]

...or something like that

Ken

Posted

There is some scope for confusion here.

FileMaker has two commands which use the term 'zoom' with quite different meanings.

The first is the "Toggle Window [Zoom]" command, which autmatically adjusts the width and height of the window to accommodate all objects on the current layout.

The second is the "Set Zoom Level [100%]" command, which changes the magnification to a fixed value (25%, 50%, 75%, 100%, 150%, 200% 300% or 400%) or jumps to the next fixed value up or down using 'Zoom In' or 'Zoom out' parameters.

I guess the important point from my previous post is that Toggle Window [Zoom] - which was the single step in the start up script in question - will produce different window dimensions at different magnification levels, and therefore its operation is context dependent in this respect (as well as the others I mentioned). That is if you call 'Toggle Window [Zoom]' while magnification is at 150%, the resulting window dimensions will be larger than if you call Toggle Window [Zoom] with magnification at 100%.

I was therefore suggesting that additional steps be called prior to the Toggle Window [Zoom] step in the start-up script (to set up a consistent context) rather than as an alternative...

Posted

If the file is opened by virtue of a relationship, valuelist or scripting requirement from another file the "start script" does NOT RUN. As a consequence, any successive attempts to open the already open file will merely bring it to foreground - -once again the "open script" fails to execute because the file is already open.

I overcame this by forcibly executing the nominated "start script" from other files - thus getting the display at correct size and the file correctly initialized.

Posted

For some reason it sounds to me like there are instances where the file is opened by an opening file, and other cases where the file is opened independently (not sure why, but i'm sure he has his reason).

Ken

Posted

mikemccloskey has already clarified this in his posting on 8/22 in which he said:

I have several related files that contain buttons that take user to this partacular (File A) file. Those buttons trigger the external (file A) script which zooms and halts as you suggested. It works fine there. But if I simply open the file by itself the "upon openingl, run x script" preference for that same script doesn't work.
So it seems that the issue centers solely on the way the script acts on the file (or fails to act/act appropriately on it?!...) when it executes in response to the file open preference setting in the 'Edit > Preferences > Document...' dialog.

This topic is 8185 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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