Executing script based on pull-down selection
Author |
Message |
Warner Onstin #1 / 17
|
 Executing script based on pull-down selection
Hi all, I've seen similar things posted in the archive, but none that answer this question directly. If I have a pull down of items (value list), and a user changes or selects a value is there a way to trigger a script to run? I found some code yesterday, but before I saved it I had a power fluctuation which shut down my computer. I know that event-based scripting isn't available, but I was hoping someone had found a way around this one. -warner
|
Tue, 04 Nov 2003 00:05:31 GMT |
|
 |
GS #2 / 17
|
 Executing script based on pull-down selection
The basic idea is to format your field with the value list as a pop-up menu and then define it as a button that performs the following script. Go To Field [Select/Perform, YourField] Pause/Resume Script [0:00:00] Perform Script [or whatever here] -- Glenn Schwandt
Quote: > Hi all, > I've seen similar things posted in the archive, but none that answer this > question directly. If I have a pull down of items (value list), and a user > changes or selects a value is there a way to trigger a script to run? > I found some code yesterday, but before I saved it I had a power fluctuation > which shut down my computer. I know that event-based scripting isn't > available, but I was hoping someone had found a way around this one. > -warner
|
Tue, 04 Nov 2003 03:48:02 GMT |
|
 |
Warner Onstin #3 / 17
|
 Executing script based on pull-down selection
Thanks! Just started trying it and here's what happens: If I leave the Pause/Resume at 0 then it doesn't give me time to select anything. If I up to 3, then it takes a long time to actually change the values. Any ideas on how to improve upon this? -warner
Quote: > The basic idea is to format your field with the value list as a pop-up menu > and then define it as a button that performs the following script. > Go To Field [Select/Perform, YourField] > Pause/Resume Script [0:00:00] > Perform Script [or whatever here] > -- > Glenn Schwandt
> > Hi all, > > I've seen similar things posted in the archive, but none that answer this > > question directly. If I have a pull down of items (value list), and a > user > > changes or selects a value is there a way to trigger a script to run? > > I found some code yesterday, but before I saved it I had a power > fluctuation > > which shut down my computer. I know that event-based scripting isn't > > available, but I was hoping someone had found a way around this one. > > -warner
|
Tue, 04 Nov 2003 04:34:23 GMT |
|
 |
Bridget El #4 / 17
|
 Executing script based on pull-down selection
Hi Warner The work around is not pretty: Go to Field [Select/perform, "FieldName"] Loop Exit Loop If ["not IsEmpty(FieldName)] If [IsEmpty(FieldName)] Pause/Resume Script [0:00:01] End If End Loop Exit Record/Request (rest of script) Format the field as a button which runs this script. Basically, the user clicks in the field triggering the script, the script selects the field which makes the popup appear, the loop checks every second until it finds an entry in the field, then the rest of the script runs. IMHO, it is more trouble than it is worth. -- Bridget Eley
Quote:
> Hi all, > I've seen similar things posted in the archive, but none that answer this > question directly. If I have a pull down of items (value list), and a user > changes or selects a value is there a way to trigger a script to run? > I found some code yesterday, but before I saved it I had a power fluctuation > which shut down my computer. I know that event-based scripting isn't > available, but I was hoping someone had found a way around this one. > -warner
|
Tue, 04 Nov 2003 04:50:05 GMT |
|
 |
Bridget El #5 / 17
|
 Executing script based on pull-down selection
Correction: Set Field [FieldName, ""] Go to Field [Select/perform, "FieldName"] Loop Exit Loop If ["not IsEmpty(FieldName)] If [IsEmpty(FieldName)] Pause/Resume Script [0:00:01] End If End Loop Exit Record/Request (rest of script)
Quote:
> Hi Warner > The work around is not pretty: > Go to Field [Select/perform, "FieldName"] > Loop > Exit Loop If ["not IsEmpty(FieldName)] > If [IsEmpty(FieldName)] > Pause/Resume Script [0:00:01] > End If > End Loop > Exit Record/Request > (rest of script) > Format the field as a button which runs this script. Basically, the user > clicks in the field triggering the script, the script selects the field > which makes the popup appear, the loop checks every second until it finds > an entry in the field, then the rest of the script runs. IMHO, it is more > trouble than it is worth. > -- > Bridget Eley
> > Hi all, > > I've seen similar things posted in the archive, but none that answer this > > question directly. If I have a pull down of items (value list), and a user > > changes or selects a value is there a way to trigger a script to run? > > I found some code yesterday, but before I saved it I had a power fluctuation > > which shut down my computer. I know that event-based scripting isn't > > available, but I was hoping someone had found a way around this one. > > -warner
|
Tue, 04 Nov 2003 04:59:59 GMT |
|
 |
Warner Onstin #6 / 17
|
 Executing script based on pull-down selection
Thanks, I had to bump up the time to 2 seconds, but that appears to have done the trick! -warner
Quote: > Correction: > Set Field [FieldName, ""] > Go to Field [Select/perform, "FieldName"] > Loop > Exit Loop If ["not IsEmpty(FieldName)] > If [IsEmpty(FieldName)] > Pause/Resume Script [0:00:01] > End If > End Loop > Exit Record/Request > (rest of script)
> > Hi Warner > > The work around is not pretty: > > Go to Field [Select/perform, "FieldName"] > > Loop > > Exit Loop If ["not IsEmpty(FieldName)] > > If [IsEmpty(FieldName)] > > Pause/Resume Script [0:00:01] > > End If > > End Loop > > Exit Record/Request > > (rest of script) > > Format the field as a button which runs this script. Basically, the user > > clicks in the field triggering the script, the script selects the field > > which makes the popup appear, the loop checks every second until it finds > > an entry in the field, then the rest of the script runs. IMHO, it is more > > trouble than it is worth. > > -- > > Bridget Eley
> > > Hi all, > > > I've seen similar things posted in the archive, but none that answer this > > > question directly. If I have a pull down of items (value list), and a user > > > changes or selects a value is there a way to trigger a script to run? > > > I found some code yesterday, but before I saved it I had a power fluctuation > > > which shut down my computer. I know that event-based scripting isn't > > > available, but I was hoping someone had found a way around this one. > > > -warner
|
Tue, 04 Nov 2003 09:21:18 GMT |
|
 |
Bridget El #7 / 17
|
 Executing script based on pull-down selection
Hi Warner When both the value list and the time it takes to decide on the value are short, and everything goes according to plan, the technique works reasonably well.
With long value lists and long decision making times, there is an annoying flicker between paused and resumed state of script as the loop checks every second to see if the field is empty. To set the pause to longer than a second would be even more annoying as the user would have to wait too long for something to happen after making the selection. The flicker can be eliminated to some extent by hiding the status area and ensuring that the background colour is white, but there is no way to avoid the changes of state in the cursor from arrow to clock. The second problem arises if users tabs rather than click into the field (especially common with data entry specialists). Tabbing into a field will not trigger the script. Therefore you have to make sure the field is removed from the tab order. A more serious problem (because there really is no remedy for it) is that users could use the escape key to get rid of the pop-up list then manually enter a non-authorised value. Pressing the cancel button in the Status Area (or keyboard shortcut) will also have the same effect. You could use validation to ensure that only authorised values are entered, but there would be no way to resume the script afterwards. And while adding the Allow User Abort [Off] script step to the beginning of the script will remove the Cancel button from the Status Area, the keyboard shortcut will still thwart the script. -- Bridget Eley
Quote:
> Thanks, > I had to bump up the time to 2 seconds, but that appears to have done the > trick! > -warner
> > Correction: > > Set Field [FieldName, ""] > > Go to Field [Select/perform, "FieldName"] > > Loop > > Exit Loop If ["not IsEmpty(FieldName)] > > If [IsEmpty(FieldName)] > > Pause/Resume Script [0:00:01] > > End If > > End Loop > > Exit Record/Request > > (rest of script)
> > > Hi Warner > > > The work around is not pretty: > > > Go to Field [Select/perform, "FieldName"] > > > Loop > > > Exit Loop If ["not IsEmpty(FieldName)] > > > If [IsEmpty(FieldName)] > > > Pause/Resume Script [0:00:01] > > > End If > > > End Loop > > > Exit Record/Request > > > (rest of script) > > > Format the field as a button which runs this script. Basically, the > user > > > clicks in the field triggering the script, the script selects the field > > > which makes the popup appear, the loop checks every second until it > finds > > > an entry in the field, then the rest of the script runs. IMHO, it is > more > > > trouble than it is worth. > > > -- > > > Bridget Eley
> > > > Hi all, > > > > I've seen similar things posted in the archive, but none that answer > this > > > > question directly. If I have a pull down of items (value list), and a > user > > > > changes or selects a value is there a way to trigger a script to run? > > > > I found some code yesterday, but before I saved it I had a power > fluctuation > > > > which shut down my computer. I know that event-based scripting isn't > > > > available, but I was hoping someone had found a way around this one. > > > > -warner
|
Tue, 04 Nov 2003 11:17:23 GMT |
|
 |
Warner Onstin #8 / 17
|
 Executing script based on pull-down selection
Wow, thanks for the heads up. I'll make sure that I put that into some kindof pop-up help. The main user will know, but who knows who will use it later. -warner
|
Tue, 04 Nov 2003 11:32:53 GMT |
|
 |
C. Alex Lord #9 / 17
|
 Executing script based on pull-down selection
There is a convenient bug in FM. If you are using a pop up menu- not list- then the pause of 0:00:00 will last until the user makes a selection. -- C. Alex Lorda
Quote: > Thanks! Just started trying it and here's what happens: > If I leave the Pause/Resume at 0 then it doesn't give me time to select > anything. If I up to 3, then it takes a long time to actually change the > values. Any ideas on how to improve upon this? > -warner
> > The basic idea is to format your field with the value list as a pop-up > menu > > and then define it as a button that performs the following script. > > Go To Field [Select/Perform, YourField] > > Pause/Resume Script [0:00:00] > > Perform Script [or whatever here] > > -- > > Glenn Schwandt
> > > Hi all, > > > I've seen similar things posted in the archive, but none that answer > this > > > question directly. If I have a pull down of items (value list), and a > > user > > > changes or selects a value is there a way to trigger a script to run? > > > I found some code yesterday, but before I saved it I had a power > > fluctuation > > > which shut down my computer. I know that event-based scripting isn't > > > available, but I was hoping someone had found a way around this one. > > > -warner
|
Tue, 04 Nov 2003 18:25:29 GMT |
|
 |
RDB #10 / 17
|
 Executing script based on pull-down selection
I have used a solution very similar to Bridget's (see below), but with some twists: 1) Instead of isempty(), I have used Not Equal. set tempfldname = fieldname Go to Field [Select/perform, "FieldName"] Loop Exit Loop If [if(tempfldname not equal fieldName] etc. Now if the user changes the existing fieldname, the script will continue. I don't know a solution to the flicker (although I'm going to test the set time 0:0:0:0), but tying to a bug is not comforting) Another twist that I put in is to NOT use the if/then shown below. I haven't found it to be necessary to include the logic, I simply include the Pause/Resume. Lastly, I have included a 'stop gap' end loop statement (sometimes people simply don't make a decision). I include a simple increment in the script: setfield[tempfld2] = 0 --- this field would never be seen on the screen/layout set tempfldname = fieldname Go to Field [Select/perform, "FieldName"] Loop setfield[tempfld2] = tempfld2 + 1 Exit Loop If [if(tempfldname not equal fieldName OR tempfld2 > 5] --- you can pick any number here Pause/Resume Script [0:00:01] end loop exit record/request Now if the person tabs out, the script will continue to a count of 5 and complete -- but the value is what it was when it started. I have the script then do nothing (nothing changed). However, it will end and the value list will disappear. By the way, I found that only "pop-up list" allows this to work on a single 'click'. Dick Quote:
> Correction: > Set Field [FieldName, ""] > Go to Field [Select/perform, "FieldName"] > Loop > Exit Loop If ["not IsEmpty(FieldName)] > If [IsEmpty(FieldName)] > Pause/Resume Script [0:00:01] > End If > End Loop > Exit Record/Request > (rest of script)
> > Hi Warner > > The work around is not pretty: > > Go to Field [Select/perform, "FieldName"] > > Loop > > Exit Loop If ["not IsEmpty(FieldName)] > > If [IsEmpty(FieldName)] > > Pause/Resume Script [0:00:01] > > End If > > End Loop > > Exit Record/Request > > (rest of script) > > Format the field as a button which runs this script. Basically, the user > > clicks in the field triggering the script, the script selects the field > > which makes the popup appear, the loop checks every second until it finds > > an entry in the field, then the rest of the script runs. IMHO, it is more > > trouble than it is worth. > > -- > > Bridget Eley
> > > Hi all, > > > I've seen similar things posted in the archive, but none that answer this > > > question directly. If I have a pull down of items (value list), and a user > > > changes or selects a value is there a way to trigger a script to run? > > > I found some code yesterday, but before I saved it I had a power fluctuation > > > which shut down my computer. I know that event-based scripting isn't > > > available, but I was hoping someone had found a way around this one. > > > -warner
|
Tue, 04 Nov 2003 20:57:55 GMT |
|
 |
Bridget El #11 / 17
|
 Executing script based on pull-down selection
Hi Alex I have tried this and while it seems more responsive to the selection, the flicker between the two states of the loop while deciding which selection to make is even more maddening than when set at 1 second. What happens on your machine(s)? Bridget
Quote:
> There is a convenient bug in FM. If you are using a pop up menu- not list- > then the pause of 0:00:00 will last until the user makes a selection. > -- > C. Alex Lorda
> > Thanks! Just started trying it and here's what happens: > > If I leave the Pause/Resume at 0 then it doesn't give me time to select > > anything. If I up to 3, then it takes a long time to actually change the > > values. Any ideas on how to improve upon this? > > -warner
> > > The basic idea is to format your field with the value list as a pop-up > > menu > > > and then define it as a button that performs the following script. > > > Go To Field [Select/Perform, YourField] > > > Pause/Resume Script [0:00:00] > > > Perform Script [or whatever here] > > > -- > > > Glenn Schwandt
> > > > Hi all, > > > > I've seen similar things posted in the archive, but none that answer > > this > > > > question directly. If I have a pull down of items (value list), and a > > > user > > > > changes or selects a value is there a way to trigger a script to run? > > > > I found some code yesterday, but before I saved it I had a power > > > fluctuation > > > > which shut down my computer. I know that event-based scripting isn't > > > > available, but I was hoping someone had found a way around this one. > > > > -warner
|
Wed, 05 Nov 2003 04:50:26 GMT |
|
 |
C. Alex Lord #12 / 17
|
 Executing script based on pull-down selection
Hi Bridget, Actually there's no need for a loop with a menu. The scrip works as Glenn gave it; you just set the scrip to pause for 0's and for what ever reason it will wait for a selection and then continue. -- C. Alex Lorda
Quote: > Hi Alex > I have tried this and while it seems more responsive to the selection, the > flicker between the two states of the loop while deciding which selection > to make is even more maddening than when set at 1 second. What happens on > your machine(s)? > Bridget
> > There is a convenient bug in FM. If you are using a pop up menu- not list- > > then the pause of 0:00:00 will last until the user makes a selection. > > -- > > C. Alex Lorda
> > > Thanks! Just started trying it and here's what happens: > > > If I leave the Pause/Resume at 0 then it doesn't give me time to select > > > anything. If I up to 3, then it takes a long time to actually change the > > > values. Any ideas on how to improve upon this? > > > -warner
> > > > The basic idea is to format your field with the value list as a pop-up > > > menu > > > > and then define it as a button that performs the following script. > > > > Go To Field [Select/Perform, YourField] > > > > Pause/Resume Script [0:00:00] > > > > Perform Script [or whatever here] > > > > -- > > > > Glenn Schwandt
> > > > > Hi all, > > > > > I've seen similar things posted in the archive, but none that answer > > > this > > > > > question directly. If I have a pull down of items (value list), and a > > > > user > > > > > changes or selects a value is there a way to trigger a script to run? > > > > > I found some code yesterday, but before I saved it I had a power > > > > fluctuation > > > > > which shut down my computer. I know that event-based scripting isn't > > > > > available, but I was hoping someone had found a way around this one. > > > > > -warner
|
Wed, 05 Nov 2003 11:19:57 GMT |
|
 |
Bridget El #13 / 17
|
 Executing script based on pull-down selection
Now that you mention it, I seem to recall you went to some trouble to explain this once before but for some reason it just didn't stick. Thanks, Alex!
Quote:
> Hi Bridget, > Actually there's no need for a loop with a menu. The scrip works as Glenn > gave it; you just set the scrip to pause for 0's and for what ever reason it > will wait for a selection and then continue. > -- > C. Alex Lorda
> > Hi Alex > > I have tried this and while it seems more responsive to the selection, the > > flicker between the two states of the loop while deciding which selection > > to make is even more maddening than when set at 1 second. What happens on > > your machine(s)? > > Bridget
> > > There is a convenient bug in FM. If you are using a pop up menu- not > list- > > > then the pause of 0:00:00 will last until the user makes a selection. > > > -- > > > C. Alex Lorda
> > > > Thanks! Just started trying it and here's what happens: > > > > If I leave the Pause/Resume at 0 then it doesn't give me time to > select > > > > anything. If I up to 3, then it takes a long time to actually change > the > > > > values. Any ideas on how to improve upon this? > > > > -warner
> > > > > The basic idea is to format your field with the value list as a > pop-up > > > > menu > > > > > and then define it as a button that performs the following script. > > > > > Go To Field [Select/Perform, YourField] > > > > > Pause/Resume Script [0:00:00] > > > > > Perform Script [or whatever here] > > > > > -- > > > > > Glenn Schwandt
> > > > > > Hi all, > > > > > > I've seen similar things posted in the archive, but none that > answer > > > > this > > > > > > question directly. If I have a pull down of items (value list), > and a > > > > > user > > > > > > changes or selects a value is there a way to trigger a script to > run? > > > > > > I found some code yesterday, but before I saved it I had a power > > > > > fluctuation > > > > > > which shut down my computer. I know that event-based scripting > isn't > > > > > > available, but I was hoping someone had found a way around this > one. > > > > > > -warner
|
Wed, 05 Nov 2003 12:28:47 GMT |
|
 |
Bridget El #14 / 17
|
 Executing script based on pull-down selection
Now I remember why it didn't stick - I couldn't get it to work on my machine, and I still can't. :-( Bridget
Quote:
> Now that you mention it, I seem to recall you went to some trouble to > explain this once before but for some reason it just didn't stick. > Thanks, Alex!
> > Hi Bridget, > > Actually there's no need for a loop with a menu. The scrip works as Glenn > > gave it; you just set the scrip to pause for 0's and for what ever reason it > > will wait for a selection and then continue. > > -- > > C. Alex Lorda
> > > Hi Alex > > > I have tried this and while it seems more responsive to the selection, the > > > flicker between the two states of the loop while deciding which selection > > > to make is even more maddening than when set at 1 second. What happens on > > > your machine(s)? > > > Bridget
> > > > There is a convenient bug in FM. If you are using a pop up menu- not > > list- > > > > then the pause of 0:00:00 will last until the user makes a selection. > > > > -- > > > > C. Alex Lorda
> > > > > Thanks! Just started trying it and here's what happens: > > > > > If I leave the Pause/Resume at 0 then it doesn't give me time to > > select > > > > > anything. If I up to 3, then it takes a long time to actually change > > the > > > > > values. Any ideas on how to improve upon this? > > > > > -warner
> > > > > > The basic idea is to format your field with the value list as a > > pop-up > > > > > menu > > > > > > and then define it as a button that performs the following script. > > > > > > Go To Field [Select/Perform, YourField] > > > > > > Pause/Resume Script [0:00:00] > > > > > > Perform Script [or whatever here] > > > > > > -- > > > > > > Glenn Schwandt
> > > > > > > Hi all, > > > > > > > I've seen similar things posted in the archive, but none that > > answer > > > > > this > > > > > > > question directly. If I have a pull down of items (value list), > > and a > > > > > > user > > > > > > > changes or selects a value is there a way to trigger a script to > > run? > > > > > > > I found some code yesterday, but before I saved it I had a power > > > > > > fluctuation > > > > > > > which shut down my computer. I know that event-based scripting > > isn't > > > > > > > available, but I was hoping someone had found a way around this > > one. > > > > > > > -warner
|
Wed, 05 Nov 2003 16:27:22 GMT |
|
 |
Ruben van den Boogaar #15 / 17
|
 Executing script based on pull-down selection
Hi Alex and Bridget, I tried the 00.00.00 wait on my Mac, but that doesn't seem to work (G4 OS 9.1 FM 4.1v3), the menu is not opened, so the script continues. it opens a Menu list, but then doesn't stop. I tried it under Virtual PC Win 95, (emulated on my G4) with a pop-up menu op 500 names, and that worked 1 out of 2 times. It appears like it sometimes takes to long to build the menu?! Any idears?? Ruben
Quote: > Hi Alex > I have tried this and while it seems more responsive to the selection, the > flicker between the two states of the loop while deciding which selection > to make is even more maddening than when set at 1 second. What happens on > your machine(s)? > Bridget
> > There is a convenient bug in FM. If you are using a pop up menu- not list- > > then the pause of 0:00:00 will last until the user makes a selection. > > -- > > C. Alex Lorda
> > > Thanks! Just started trying it and here's what happens: > > > If I leave the Pause/Resume at 0 then it doesn't give me time to select > > > anything. If I up to 3, then it takes a long time to actually change the > > > values. Any ideas on how to improve upon this? > > > -warner
> > > > The basic idea is to format your field with the value list as a pop-up > > > menu > > > > and then define it as a button that performs the following script. > > > > Go To Field [Select/Perform, YourField] > > > > Pause/Resume Script [0:00:00] > > > > Perform Script [or whatever here] > > > > -- > > > > Glenn Schwandt
> > > > > Hi all, > > > > > I've seen similar things posted in the archive, but none that answer > > > this > > > > > question directly. If I have a pull down of items (value list), and a > > > > user > > > > > changes or selects a value is there a way to trigger a script to run? > > > > > I found some code yesterday, but before I saved it I had a power > > > > fluctuation > > > > > which shut down my computer. I know that event-based scripting isn't > > > > > available, but I was hoping someone had found a way around this one. > > > > > -warner
|
Wed, 05 Nov 2003 16:35:53 GMT |
|
|
Page 1 of 2
|
[ 17 post ] |
|
Go to page:
[1]
[2] |
|