Script to other file 
Author Message
 Script to other file

Hello,
    I'm working out my first scripts and have 2 questions.
1. This regards how to navigate from one file to the next with a script. I'm
able to build one that goes from
master file to related file using the "Go to related" step and executing a
script local to related. What is
most important is that the "focus" ends up with the related file.
    -when I try to do this in reverse (from related file to master) the
focus always ends up back in the related
file again. Maybe I need to make a new relationship in reverse to access
this navigation. If there is a
simpler way (I don't see anything like a "Go to file..." script) would
really like to know.
2. About saving settings. How do you check what setting a script has for a
find? And how does a find
operate in a script? I would like to set a find that finds records that
match the current invoice number.
As I read about finds, it appears you need to specify a value for an invoice
rather than, say, "find invoices
that = invoice number of Status(Current Record)".
Thanks,
Bill


Sat, 21 Jun 2003 01:32:55 GMT
 Script to other file

Bill,

The very last scrip step executed is the one that determines which file has
focus (is active). So, if the script in File A calls a subscript in File B,
but you want to end up back in file A, make sure that the last action occurs
in a script in File A, even if it's only a step in the main (original,
calling) script that calls something like "Go to Main Layout", or, "Go to
Field"-- even if a field isn't specified.

Similarly, if you want to end up in file B, make sure that the last script
step is called from File B.

Note that you need not use Go to Related Record. Simply calling an external
script-- a script in File B from File A-- will "go to" File B,  and open it
if it is not already open. Note also that external scripts can be called
regardless of whether or not the file is related to the calling file. GTRR
is useful more for creating a found set.

As for controlling Finds, etc.:

Each script can "hold" one version of a Find, a Sort, an Export, Import, and
a Print Setup. These are created by first performing the action and then
creating a script that calls the action, along with "Restore". Using
"Restore" will 'restore' the settings for the action to the way it was when
the script was created. To change the stored setting, perform the action
with different criteria, re-open the script definition, and choose 'OK'
rather than 'Cancel'. When you close the window, you will be prompted to
choose to keep or replace the values for any of the five stored dynamic
steps; choose "Replace".

If you do not use "Restore" in the script step (for Find, in either Enter
Find Mode or Find), further instructions are needed to perform the action,
which is what you want in a user or script controlled Find. To find a
specific invoice, have your script, in Browse mode before the find, set a
global field to the value for the invoice number:

Set Field["gInvoice Number", "Invoice Number"]

Then enter Find mode (you don't need to pause) without Restore, then:

Set Field["Invoice Number", "gInvoice Number"]
Perform Find[]

Those last empty brackets indicate no Restore.

When I am creating scripts that use the stored dynamic value, I always add a
comment line to the script step so that I will remember what the criteria
were. This doesn't matter so much for Sorting, because calling Sort manually
will default to the last Sort order, but is necessary for Find, to remember
what the Find criteria were.

--
John Weinshel
datagrace
Associate Member, Filemaker Solutions Alliance
Vashon Island, WA
(206) 463-1634


Quote:
> Hello,
>     I'm working out my first scripts and have 2 questions.
> 1. This regards how to navigate from one file to the next with a script.
I'm
> able to build one that goes from
> master file to related file using the "Go to related" step and executing a
> script local to related. What is
> most important is that the "focus" ends up with the related file.
>     -when I try to do this in reverse (from related file to master) the
> focus always ends up back in the related
> file again. Maybe I need to make a new relationship in reverse to access
> this navigation. If there is a
> simpler way (I don't see anything like a "Go to file..." script) would
> really like to know.
> 2. About saving settings. How do you check what setting a script has for a
> find? And how does a find
> operate in a script? I would like to set a find that finds records that
> match the current invoice number.
> As I read about finds, it appears you need to specify a value for an
invoice
> rather than, say, "find invoices
> that = invoice number of Status(Current Record)".
> Thanks,
> Bill



Sat, 21 Jun 2003 02:23:44 GMT
 Script to other file
I just have a couple of minor points to add to John's already
comprehensive response:

Quote:
> The very last scrip step executed is the one that determines which file has
> focus (is active). So, if the script in File A calls a subscript in File B,
> but you want to end up back in file A, make sure that the last action occurs
> in a script in File A, even if it's only a step in the main (original,
> calling) script that calls something like "Go to Main Layout", or, "Go to
> Field"-- even if a field isn't specified.

Exit Record is another good step to use for this purpose.  It doesn't
actually move out of the current record, just out of any field that might
have been selected within the record.

Also, to find out what find criteria have been stored by a script, print
the script.

--
Bridget Eley


Quote:

> Bill,

> The very last scrip step executed is the one that determines which file has
> focus (is active). So, if the script in File A calls a subscript in File B,
> but you want to end up back in file A, make sure that the last action occurs
> in a script in File A, even if it's only a step in the main (original,
> calling) script that calls something like "Go to Main Layout", or, "Go to
> Field"-- even if a field isn't specified.

> Similarly, if you want to end up in file B, make sure that the last script
> step is called from File B.

> Note that you need not use Go to Related Record. Simply calling an external
> script-- a script in File B from File A-- will "go to" File B,  and open it
> if it is not already open. Note also that external scripts can be called
> regardless of whether or not the file is related to the calling file. GTRR
> is useful more for creating a found set.

> As for controlling Finds, etc.:

> Each script can "hold" one version of a Find, a Sort, an Export, Import, and
> a Print Setup. These are created by first performing the action and then
> creating a script that calls the action, along with "Restore". Using
> "Restore" will 'restore' the settings for the action to the way it was when
> the script was created. To change the stored setting, perform the action
> with different criteria, re-open the script definition, and choose 'OK'
> rather than 'Cancel'. When you close the window, you will be prompted to
> choose to keep or replace the values for any of the five stored dynamic
> steps; choose "Replace".

> If you do not use "Restore" in the script step (for Find, in either Enter
> Find Mode or Find), further instructions are needed to perform the action,
> which is what you want in a user or script controlled Find. To find a
> specific invoice, have your script, in Browse mode before the find, set a
> global field to the value for the invoice number:

> Set Field["gInvoice Number", "Invoice Number"]

> Then enter Find mode (you don't need to pause) without Restore, then:

> Set Field["Invoice Number", "gInvoice Number"]
> Perform Find[]

> Those last empty brackets indicate no Restore.

> When I am creating scripts that use the stored dynamic value, I always add a
> comment line to the script step so that I will remember what the criteria
> were. This doesn't matter so much for Sorting, because calling Sort manually
> will default to the last Sort order, but is necessary for Find, to remember
> what the Find criteria were.

> --
> John Weinshel
> datagrace
> Associate Member, Filemaker Solutions Alliance
> Vashon Island, WA
> (206) 463-1634



> > Hello,
> >     I'm working out my first scripts and have 2 questions.
> > 1. This regards how to navigate from one file to the next with a script.
> I'm
> > able to build one that goes from
> > master file to related file using the "Go to related" step and executing a
> > script local to related. What is
> > most important is that the "focus" ends up with the related file.
> >     -when I try to do this in reverse (from related file to master) the
> > focus always ends up back in the related
> > file again. Maybe I need to make a new relationship in reverse to access
> > this navigation. If there is a
> > simpler way (I don't see anything like a "Go to file..." script) would
> > really like to know.
> > 2. About saving settings. How do you check what setting a script has for a
> > find? And how does a find
> > operate in a script? I would like to set a find that finds records that
> > match the current invoice number.
> > As I read about finds, it appears you need to specify a value for an
> invoice
> > rather than, say, "find invoices
> > that = invoice number of Status(Current Record)".
> > Thanks,
> > Bill



Sat, 21 Jun 2003 04:06:25 GMT
 Script to other file


Quote:
>Also, to find out what find criteria have been stored by a script, print
>the script.

This is probably a dumb question but how do you print the script.  I can't see
how to do this in version 4.

Andrew Currie
Queen's University
Kingston, Ontario, Canada



Sun, 22 Jun 2003 23:44:26 GMT
 Script to other file
Look at "Printing your data" in the help file.
--
Glenn Schwandt



Quote:


> >Also, to find out what find criteria have been stored by a script, print
> >the script.

> This is probably a dumb question but how do you print the script.  I
can't see
> how to do this in version 4.

> Andrew Currie
> Queen's University
> Kingston, Ontario, Canada



Mon, 23 Jun 2003 00:35:46 GMT
 Script to other file
Not dumb, just not obvious.  You just select the normal print command from
the file menu (or press print keyboard shortcut) and then select the
script option from the print dialogue.  You can elect to print any or all
scripts by making a selection from the popup menu.  You can also print
field definitions this way.  At least, this is how you do it on a Mac.  I
imagine the PC version is similar.

--


Quote:



> >Also, to find out what find criteria have been stored by a script, print
> >the script.

> This is probably a dumb question but how do you print the script.  I
can't see
> how to do this in version 4.

> Andrew Currie
> Queen's University
> Kingston, Ontario, Canada



Mon, 23 Jun 2003 04:33:40 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. How to Call a SQL Script file from another SQL Script File

2. Linking Access Tables in Different *.mdb Files, Populating an Access Table From Several Others

3. DT File Manager and others

4. How do you script all object of a database to a script file

5. How to call file(script1.sql) from inside the script (script.sql)

6. Need Windows Scripting Host script to BCP a file using SQL-DMO

7. Find using a scripting and multiple fields - Scripts between files - Barcode plug-ins

8. Q: SQL file script -- file input mode

9. SGML->DSSSL(or others)->SQL(or others)?

10. How to create a insert script file (*.sql)?

11. Executing SQL script file

12. Creating a Database using scripts, and loading initial data from text files


 
Powered by phpBB® Forum Software