Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

As I understand it, if you open a file directly which has a start-up script defined in the file options dialog, the script will run.

However, if the file has been opened hidden, because of some relationship between it and the currently open database, the startup script seems not to run.

Also, if I specify a script step in my current file which runs a script (not the start-up script) in another file that isn't open, the start-up script does not run.

Is there a way of forcing the start-up script to run whatever way the file is opened?

What I am trying to achieve is to set some global fields for the user however the file is opened - perhaps I need to use a different approach?

Thanks

Brian

Posted

Couldn't you add a perform script step to perform the startup script anytime the file is referenced?

  • 1 month later...
Posted

I ran into this problem recently as well. I have a start-up script that set's global variables that are used by all other scripts, so the start-up script must run before any other script does.

The kicker for me was that I wanted the 2nd file to be able to be closed, keeping the 1st file open, then the next time the 1st file tries to run a script from the 2nd file, it would open, run it's start-up script, then run the script that was called from the 1st file.

(ok, if anyone followed what I said there, then congrats. if you didn't understand it, it's not that important anyways)

Here is the method I came up with:

1) use 'File Options' to switch to a layout on opening (I call the layout: 'RunOnOpen')

2) in the 'RunOnOpen' layout, define a script trigger on event OnLayoutEnter in Browse mode to call your start-up script (I also call my script: 'RunOnOpen')

3) in the start-up script, make one of the first script steps be Go To Layout[any other layout], to prevent the start-up script from running again (which would happen if you opened a new window, performed a find, etc.)

In my testing, I could not run a script or view a layout in the 2nd file without the start-up script running first.

This topic is 5114 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.