Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FM scripting problem

Status
Not open for further replies.

fearog

IS-IT--Management
Sep 7, 2006
3
GB
Hi,
I'm a complete newbie to FileMaker scripting. I want to open a bunch of files (easy) and, for each one, open the Sharing dialog box and tick the 'Web Companion' box. While I can use 'Open Sharing' to open the dialog box, how do I set 'Web Companion' to On? Is it possible?

Thanks.
 
fearog,

What version of Filemaker are you using and are you asking how to script the checking of the checkbox or just how to manually check it?

-Striker
 
Striker,

I'm using FM5 and I want the script to check the Web Companion checkbox for each file the script opens. I would settle for being presented with the dialog box so that the user checks the checkbox but I tried that and it didn't work properly. The existing script opens the files one after another. I inserted 'Open Sharing' after each 'Open [filename]'. When the script ran it opened file1 and presented the checkbox for file1. When I checked the checkbox and clicked OK it opened file2 and presented the dialog box for file1 again (with the checkbox already checked).

 
fearog,

I'm sorry but I can't help you. I never used Web Companion and it has been a few years since I've done anything with version 5 so my memory has faded and I have no old version to refer to.

Jean may be able to help. She is a obviously a FM guru and I suspect that her memory is better than mine.

My guess is that it can't be done. Generally speaking, database setup like this can't be scripted in Filemaker.

-Striker
 
Maybe I'm missing something, but I strongly advise against this.
Never let a user change those settings.
They have to be set by the developer or the 'administrator' and have to be the same for all the files in the application.
Not, shared for one file and not shared for another.

With the Open... script steps you can reach the settingscreens to change settings, but again, never give that into the hands of a user.

Maybe if you can tell us the 'why', we could help you better.

@ Striker. My memory is not better than yours...older maybe, yes, but not better... :)
 
The reason for checking the 'Web Companion' checkbox on those files is that we are using a standalone machine running FM5 to 'present' those files to a web application that sucks the data out of them and passes them to a web page. The machine does not have a user, it just opens the files and the 'Web Companion' box needs to be checked to make them available.
I'm just trying to automate opening the files (already done) and checking the 'Web Companion' box (manual process at present).

I guess my question boils down to: is it possible to 'get at' the individual elements within a dialog box from a script?
 
Well, then the answer is that you can get until the setting screen with a script, no further.

Once there, you have to navigate to the right screen and check the settings.

As the scriptsteps indicate, it's only Open.....

To automate that, to a certain level, for all the files you can 'loop' through the fles in the application and call each script separately.

To be sure you 'hit' all the files in the application, you could make a list of the available files and make a check against the running script.

You could use two portals, one with the 'filepool' and one with the already checked files.
After each file, change the setting of the file, which will put the filename in the checked file list.
As long as your pool is not empty, you know yu didn't hit all the files in the application.
 
To make it clear, each script has to be called from within each file.

The 'central calling' can be done from within one masterfile. Otherwise you will always open the application within the same calling file, what is what you mentioned in your post.

But I would re-think the design, to make it sure only one file is open to the web. Or at least look if it is possible to have no more then 1 file open to the web.
Think about it as a separation model, where you have 1 file open to the user, while the data is in another file, only acessible through relationship.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top