Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.filemaker > #2110 > unrolled thread
| Started by | csampson@inetworld.net (Charles H. Sampson) |
|---|---|
| First post | 2015-03-17 18:51 -0700 |
| Last post | 2015-03-20 00:00 -0700 |
| Articles | 9 — 3 participants |
Back to article view | Back to comp.databases.filemaker
Problem in Setting Up a Script Sort csampson@inetworld.net (Charles H. Sampson) - 2015-03-17 18:51 -0700
Re: Problem in Setting Up a Script Sort Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-03-18 18:26 +1200
Re: Problem in Setting Up a Script Sort csampson@inetworld.net (Charles H. Sampson) - 2015-03-18 13:56 -0700
Re: Problem in Setting Up a Script Sort Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-03-19 13:26 +1200
Re: Problem in Setting Up a Script Sort Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-03-19 16:08 +1200
Re: Problem in Setting Up a Script Sort csampson@inetworld.net (Charles H. Sampson) - 2015-03-20 00:00 -0700
Re: Problem in Setting Up a Script Sort Helpful Harry <HelpfulHarry@BusyWorking.com> - 2015-03-21 09:51 +1200
Re: Problem in Setting Up a Script Sort Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2015-03-18 10:39 -0700
Re: Problem in Setting Up a Script Sort csampson@inetworld.net (Charles H. Sampson) - 2015-03-20 00:00 -0700
| From | csampson@inetworld.net (Charles H. Sampson) |
|---|---|
| Date | 2015-03-17 18:51 -0700 |
| Subject | Problem in Setting Up a Script Sort |
| Message-ID | <1m1fyqf.ov474b1lzxpn9N%csampson@inetworld.net> |
I have a recurring but not consistent problem with sorting in a script. From time to time I get into a situation where, when trying to specify the sort parameters, I'm only allowed to choose fields from something that ScriptMaker call "Current Table" and it's not the table that I want to sort. All other tables are greyed out in the drop-down menu. It doesn't happen every time. I've tried such unlikely things as changing the mode I'm in while working on the script. Browse, Find, Layout, or Preview makes no difference. What am I doing wrong? Charlie -- Nobody in this country got rich on his own. You built a factory--good. But you moved your goods on roads we all paid for. You hired workers we all paid to educate. So keep a big hunk of the money from your factory. But take a hunk and pay it forward. Elizabeth Warren (paraphrased)
[toc] | [next] | [standalone]
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Date | 2015-03-18 18:26 +1200 |
| Message-ID | <180320151826106831%HelpfulHarry@BusyWorking.com> |
| In reply to | #2110 |
In article <1m1fyqf.ov474b1lzxpn9N%csampson@inetworld.net>, Charles H.
Sampson <csampson@inetworld.net> wrote:
>
> I have a recurring but not consistent problem with sorting in a script.
> From time to time I get into a situation where, when trying to specify
> the sort parameters, I'm only allowed to choose fields from something
> that ScriptMaker call "Current Table" and it's not the table that I want
> to sort. All other tables are greyed out in the drop-down menu.
>
> It doesn't happen every time. I've tried such unlikely things as
> changing the mode I'm in while working on the script. Browse, Find,
> Layout, or Preview makes no difference.
>
> What am I doing wrong?
Just a complete guess, but maybe the current record doesn't have any
related records in other tables to sort with.
You could try adding Sort commands to Scripts in the old way:
- enter Browse Mode with a set of records
- manually Sort the records by the required field(s)
- go to the Script and insert the Sort command,
making sure to set the "Restore" option on
(assuming newer versions of FileMaker still have
the Restore option)
Just remember whenever editing that Script from then onwards to tell
FileMaker to "Keep" the stored Sort Order (instead of replacing it with
whatever the current Sort Order happens to be at that editing time).
Helpful Harry :o)
[toc] | [prev] | [next] | [standalone]
| From | csampson@inetworld.net (Charles H. Sampson) |
|---|---|
| Date | 2015-03-18 13:56 -0700 |
| Message-ID | <1m1hfhy.wxvnpgrsdgczN%csampson@inetworld.net> |
| In reply to | #2111 |
Helpful Harry <HelpfulHarry@BusyWorking.com> wrote: > In article <1m1fyqf.ov474b1lzxpn9N%csampson@inetworld.net>, Charles H. > Sampson <csampson@inetworld.net> wrote: > > > > I have a recurring but not consistent problem with sorting in a script. > > From time to time I get into a situation where, when trying to specify > > the sort parameters, I'm only allowed to choose fields from something > > that ScriptMaker call "Current Table" and it's not the table that I want > > to sort. All other tables are greyed out in the drop-down menu. > > > > It doesn't happen every time. I've tried such unlikely things as > > changing the mode I'm in while working on the script. Browse, Find, > > Layout, or Preview makes no difference. > > > > What am I doing wrong? > > Just a complete guess, but maybe the current record doesn't have any > related records in other tables to sort with. I'm not following this, Harry. I thought that I could go to a table using the Go To Layout command at any time and sort the records in that table. Without any concept of related records. Of course, if I want to sort the records of a table using data from another table, the two tables have to be related. > You could try adding Sort commands to Scripts in the old way: > > - enter Browse Mode with a set of records > > - manually Sort the records by the required field(s) > > - go to the Script and insert the Sort command, > making sure to set the "Restore" option on > (assuming newer versions of FileMaker still have > the Restore option) That works! I don't understand why, but it works. Why an action that I take as a user of the database (sorting the records of a table in browse mode) has any effect on what I can or cannot do as a script programmer is a concept beyond my grasp. Nonetheless, when I sorted the table in question and went back to ScriptMaker, that table was now the Current Table (whatever that means) and I could set up my script sort. At the same time, I now couldn't sort any other table. > Just remember whenever editing that Script from then onwards to tell > FileMaker to "Keep" the stored Sort Order (instead of replacing it with > whatever the current Sort Order happens to be at that editing time). In FMP8, when I set up a sort in a script, it appears in the text of the script as Sort [Restore]. I have no idea what that means and the Pogue Press book isn't telling. In other words, the "Restore" is automatically inserted ScriptMaker. Thanks once again, Harry. Charlie -- Nobody in this country got rich on his own. You built a factory--good. But you moved your goods on roads we all paid for. You hired workers we all paid to educate. So keep a big hunk of the money from your factory. But take a hunk and pay it forward. Elizabeth Warren (paraphrased)
[toc] | [prev] | [next] | [standalone]
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Date | 2015-03-19 13:26 +1200 |
| Message-ID | <190320151326581452%HelpfulHarry@BusyWorking.com> |
| In reply to | #2113 |
In article <1m1hfhy.wxvnpgrsdgczN%csampson@inetworld.net>, Charles H. Sampson <csampson@inetworld.net> wrote: > Helpful Harry <HelpfulHarry@BusyWorking.com> wrote: > > In article <1m1fyqf.ov474b1lzxpn9N%csampson@inetworld.net>, Charles H. > > Sampson <csampson@inetworld.net> wrote: > > > > > > I have a recurring but not consistent problem with sorting in a script. > > > From time to time I get into a situation where, when trying to specify > > > the sort parameters, I'm only allowed to choose fields from something > > > that ScriptMaker call "Current Table" and it's not the table that I want > > > to sort. All other tables are greyed out in the drop-down menu. > > > > > > It doesn't happen every time. I've tried such unlikely things as > > > changing the mode I'm in while working on the script. Browse, Find, > > > Layout, or Preview makes no difference. > > > > > > What am I doing wrong? > > > > Just a complete guess, but maybe the current record doesn't have any > > related records in other tables to sort with. > > I'm not following this, Harry. I thought that I could go to a table > using the Go To Layout command at any time and sort the records in that > table. Without any concept of related records. Of course, if I want to > sort the records of a table using data from another table, the two > tables have to be related. > > > You could try adding Sort commands to Scripts in the old way: > > > > - enter Browse Mode with a set of records > > > > - manually Sort the records by the required field(s) > > > > - go to the Script and insert the Sort command, > > making sure to set the "Restore" option on > > (assuming newer versions of FileMaker still have > > the Restore option) > > That works! I don't understand why, but it works. Why an action that I > take as a user of the database (sorting the records of a table in browse > mode) has any effect on what I can or cannot do as a script programmer > is a concept beyond my grasp. Nonetheless, when I sorted the table in > question and went back to ScriptMaker, that table was now the Current > Table (whatever that means) and I could set up my script sort. At the > same time, I now couldn't sort any other table. > > > Just remember whenever editing that Script from then onwards to tell > > FileMaker to "Keep" the stored Sort Order (instead of replacing it with > > whatever the current Sort Order happens to be at that editing time). > > In FMP8, when I set up a sort in a script, it appears in the text of the > script as Sort [Restore]. I have no idea what that means and the Pogue > Press book isn't telling. In other words, the "Restore" is automatically > inserted ScriptMaker. When being added to a Script, some commands (Sort, Print, Find, etc.) can save the most recent manual options within the Script. Whenever the Script is performed, the Restore option will mean FileMaker retrieves those saved options from the Script, rather than using whatever the current options may be. For example, if you Sort the records by FieldA and then create a Script with the Sort [Restore] command, then every time you perform that Script the records will be resorted by FieldA ... even if you have sorted them by FieldB prior to performing the Script. This is why the Enter Find Mode and Perform Find commands can cause "weird" problems if the Restore option is turned on by accident - FileMaker will use the stored Find Requests, which might then be *added* to or altered by the user / Script. That means you aren't telling FileMaker to find what you think you are. Another example is with Page Layout. You might be looking at a report you want to print, so you set the Page Layout manually to Landscape and then run a Script to print it ... but if the Script contains a Page Setup [Restore] command, then it might (for example) restore a portrait set-up that was saved with the Script and ignore your change to landscape. In ye olde days of FileMaker, these saved options were the only way to perform some tasks - you could not change which fields were used for sorting, etc. from within the Scriptmaker command itself. Instead you had to Sort the records manually, go into Scriptmaker to edit a Script, then when closing the Script tell FileMaker to replace the stored options with the new ones. Helpful Harry :o)
[toc] | [prev] | [next] | [standalone]
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Date | 2015-03-19 16:08 +1200 |
| Message-ID | <190320151608053442%HelpfulHarry@BusyWorking.com> |
| In reply to | #2114 |
In article <190320151326581452%HelpfulHarry@BusyWorking.com>, Helpful Harry <HelpfulHarry@BusyWorking.com> wrote: > > In ye olde days of FileMaker, these saved options were the only way to > perform some tasks - you could not change which fields were used for > sorting, etc. from within the Scriptmaker command itself. Instead you > had to Sort the records manually, go into Scriptmaker to edit a Script, > then when closing the Script tell FileMaker to replace the stored > options with the new ones. I should have said, in old versions of FileMaker (like mine) not only can you not change things like the Sort Order or Page Setup settings within the Script command, but you can't even see what they are within Scriptmaker ... you had to either print out the Script or use an extra developer tool. Helpful Harry :o)
[toc] | [prev] | [next] | [standalone]
| From | csampson@inetworld.net (Charles H. Sampson) |
|---|---|
| Date | 2015-03-20 00:00 -0700 |
| Message-ID | <1m1k2kg.19rep9at0grxrN%csampson@inetworld.net> |
| In reply to | #2114 |
Helpful Harry <HelpfulHarry@BusyWorking.com> wrote: > In article <1m1hfhy.wxvnpgrsdgczN%csampson@inetworld.net>, Charles H. > Sampson <csampson@inetworld.net> wrote: > > Helpful Harry <HelpfulHarry@BusyWorking.com> wrote: > > > In article <1m1fyqf.ov474b1lzxpn9N%csampson@inetworld.net>, Charles H. > > > Sampson <csampson@inetworld.net> wrote: > > > > > > > > I have a recurring but not consistent problem with sorting in a script. > > > > From time to time I get into a situation where, when trying to specify > > > > the sort parameters, I'm only allowed to choose fields from something > > > > that ScriptMaker call "Current Table" and it's not the table that I want > > > > to sort. All other tables are greyed out in the drop-down menu. > > > > > > > > It doesn't happen every time. I've tried such unlikely things as > > > > changing the mode I'm in while working on the script. Browse, Find, > > > > Layout, or Preview makes no difference. > > > > > > > > What am I doing wrong? > > > > > > Just a complete guess, but maybe the current record doesn't have any > > > related records in other tables to sort with. > > > > I'm not following this, Harry. I thought that I could go to a table > > using the Go To Layout command at any time and sort the records in that > > table. Without any concept of related records. Of course, if I want to > > sort the records of a table using data from another table, the two > > tables have to be related. > > > > > You could try adding Sort commands to Scripts in the old way: > > > > > > - enter Browse Mode with a set of records > > > > > > - manually Sort the records by the required field(s) > > > > > > - go to the Script and insert the Sort command, > > > making sure to set the "Restore" option on > > > (assuming newer versions of FileMaker still have > > > the Restore option) > > > > That works! I don't understand why, but it works. Why an action that I > > take as a user of the database (sorting the records of a table in browse > > mode) has any effect on what I can or cannot do as a script programmer > > is a concept beyond my grasp. Nonetheless, when I sorted the table in > > question and went back to ScriptMaker, that table was now the Current > > Table (whatever that means) and I could set up my script sort. At the > > same time, I now couldn't sort any other table. > > > > > Just remember whenever editing that Script from then onwards to tell > > > FileMaker to "Keep" the stored Sort Order (instead of replacing it with > > > whatever the current Sort Order happens to be at that editing time). > > > > In FMP8, when I set up a sort in a script, it appears in the text of the > > script as Sort [Restore]. I have no idea what that means and the Pogue > > Press book isn't telling. In other words, the "Restore" is automatically > > inserted ScriptMaker. > > When being added to a Script, some commands (Sort, Print, Find, etc.) > can save the most recent manual options within the Script. Whenever the > Script is performed, the Restore option will mean FileMaker retrieves > those saved options from the Script, rather than using whatever the > current options may be. > > For example, if you Sort the records by FieldA and then create a Script > with the Sort [Restore] command, then every time you perform that > Script the records will be resorted by FieldA ... even if you have > sorted them by FieldB prior to performing the Script. > > This is why the Enter Find Mode and Perform Find commands can cause > "weird" problems if the Restore option is turned on by accident - > FileMaker will use the stored Find Requests, which might then be > *added* to or altered by the user / Script. That means you aren't > telling FileMaker to find what you think you are. > > Another example is with Page Layout. You might be looking at a report > you want to print, so you set the Page Layout manually to Landscape and > then run a Script to print it ... but if the Script contains a Page > Setup [Restore] command, then it might (for example) restore a portrait > set-up that was saved with the Script and ignore your change to > landscape. > > In ye olde days of FileMaker, these saved options were the only way to > perform some tasks - you could not change which fields were used for > sorting, etc. from within the Scriptmaker command itself. Instead you > had to Sort the records manually, go into Scriptmaker to edit a Script, > then when closing the Script tell FileMaker to replace the stored > options with the new ones. Wow! You seem to go back a far ways, Harry. Did anybody at Apple/Claris/Filemaker actually design this scripting stuff, or did it just grow (like Topsy)? Charlie -- Nobody in this country got rich on his own. You built a factory--good. But you moved your goods on roads we all paid for. You hired workers we all paid to educate. So keep a big hunk of the money from your factory. But take a hunk and pay it forward. Elizabeth Warren (paraphrased)
[toc] | [prev] | [next] | [standalone]
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Date | 2015-03-21 09:51 +1200 |
| Message-ID | <210320150951119828%HelpfulHarry@BusyWorking.com> |
| In reply to | #2119 |
In article <1m1k2kg.19rep9at0grxrN%csampson@inetworld.net>, Charles H. Sampson <csampson@inetworld.net> wrote: > > Wow! You seem to go back a far ways, Harry. Did anybody at > Apple/Claris/Filemaker actually design this scripting stuff, or did it > just grow (like Topsy)? Probably a bit of both. A few commands (and functions and features) in FileMaker have changed over the years, some for the better, some for the worse, but FileMaker still beats Microsoft Access in almost every way (although thankfully Access doesn't come in a Mac version anyway). Helpful Harry :o)
[toc] | [prev] | [next] | [standalone]
| From | Howard Schlossberg <howard@nospam.fmprosolutions.com> |
|---|---|
| Date | 2015-03-18 10:39 -0700 |
| Message-ID | <mecd65$h5s$3@news.motzarella.org> |
| In reply to | #2110 |
To a degree, what's greyed out and what's not is based on the layout you are currently on while editing the script. You should however, no matter what layout you're on, have ungreyed "Unrelated Tables" available to you. What version of FM? On 3/17/2015 6:51 PM, Charles H. Sampson wrote: > I have a recurring but not consistent problem with sorting in a script. > From time to time I get into a situation where, when trying to specify > the sort parameters, I'm only allowed to choose fields from something > that ScriptMaker call "Current Table" and it's not the table that I want > to sort. All other tables are greyed out in the drop-down menu. > > It doesn't happen every time. I've tried such unlikely things as > changing the mode I'm in while working on the script. Browse, Find, > Layout, or Preview makes no difference. > > What am I doing wrong? > > Charlie >
[toc] | [prev] | [next] | [standalone]
| From | csampson@inetworld.net (Charles H. Sampson) |
|---|---|
| Date | 2015-03-20 00:00 -0700 |
| Message-ID | <1m1k2gv.io4nnk1iemef3N%csampson@inetworld.net> |
| In reply to | #2112 |
Howard Schlossberg <howard@nospam.fmprosolutions.com> wrote: > To a degree, what's greyed out and what's not is based on the layout you > are currently on while editing the script. You should however, no > matter what layout you're on, have ungreyed "Unrelated Tables" available > to you. > > What version of FM? FMP8 and all tables other than the "Current Table" are greyed out, both related and unrelated. > On 3/17/2015 6:51 PM, Charles H. Sampson wrote: > > I have a recurring but not consistent problem with sorting in a script. > > From time to time I get into a situation where, when trying to specify > > the sort parameters, I'm only allowed to choose fields from something > > that ScriptMaker call "Current Table" and it's not the table that I want > > to sort. All other tables are greyed out in the drop-down menu. > > > > It doesn't happen every time. I've tried such unlikely things as > > changing the mode I'm in while working on the script. Browse, Find, > > Layout, or Preview makes no difference. > > > > What am I doing wrong? Charlie -- Nobody in this country got rich on his own. You built a factory--good. But you moved your goods on roads we all paid for. You hired workers we all paid to educate. So keep a big hunk of the money from your factory. But take a hunk and pay it forward. Elizabeth Warren (paraphrased)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.databases.filemaker
csiph-web