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

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

Recommended Posts

Posted

I have an administrative database from which I can open and close other databases by way of scripts. The way I currently have it set up is each database that is going to be accessible via admin.fp5 has a record in admin.fp5. I want to be able to have a single script that will open a file based on the contents of the field.

For example:

admin.fp5 contains the field DATABASE which is the name of the database to be administered

so let's say records one and two in the db have the entries in the field DATABASE orders.fp5 and customers.fp5.

I want to be able to have one script called OPEN and one called CLOSE. Running the script will open or close the database listed in the DATABASE field of the current record.

The problem is that you can't pass the field contents to the name of the script you want to run. Ultimately, I will use this in a loop to go record by record and check to see if the database is open, and if it is, save a copy of it. (The database name field would come in to play here too.)

If anyone knows of a way to do this within FileMaker, please let me know. Or, if you know of a plugin that will suit my purposes, I'm happy to go that route too.

TIA,

Carrie

Posted

Hi Carrie,

If you're on a Mac the you could use Applescript & Apple Events to accomplish this.

As far as I can see you would have to write a separate AppleScript, that first gets the information about which databases to open from the 'main database' and then sends the Open Command for all those files to Filemaker.

This script, being saved as application, would then be triggered from a Filemaker script with an Apple Event script step. The reason for the use of an AppleEvent is that you can specify an Apple Event NOT to wait for completion of it's task, so Filemaker won't be 'locked up' until the script completes, thereby actually blocking the script from completing(!)

I hope that this helps, though it will require a lot of 'fiddling' I'm affraid...

But that's a lotta fun!

Success and regards,

Ernst.

Posted

you may use the openurl script step with a calculation

"file://path-to/" & filename.fp5

However, to close, you must use scripts

if [myfile="file1.fp5"]

perform scrupt, external [file1.fp5, close]

end if

if [myfile="file2.fp5"]

perform scrupt, external [file2.fp5, close]

end if

etc

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