May 21, 201213 yr I have a dropdown that I'd like to be able to change with the arrow keys, then you press enter, it commits the value, and runs the script. Instead, when I press enter, it uses whatever the value was before I chose a new one in the dropdown, and runs the script. The script adds a line item at the end of an invoice portal, currently with the wrong value (unless I click, but I'm trying to get around using the mouse). I'm sure there's something simple I'm missing here? The following script runs on keystroke: if(get(triggerkeystroke)="paragraph (symbol)") Commit records/Requests [No dialog] Perform Script ["allocate] Exit Script [result: False] So, to summarize, I want "enter" or "return" to commit the field and run the script.
May 21, 201213 yr See if this article helps you. http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/
May 22, 201213 yr I have a dropdown that I'd like to be able to change with the arrow keys, then you press enter, it commits the value, and runs the script. Instead, when I press enter, it uses whatever the value was before I chose a new one in the dropdown, and runs the script. The script adds a line item at the end of an invoice portal, currently with the wrong value (unless I click, but I'm trying to get around using the mouse). I'm sure there's something simple I'm missing here? The following script runs on keystroke: if(get(triggerkeystroke)="paragraph (symbol)") Commit records/Requests [No dialog] Perform Script ["allocate] Exit Script [result: False] So, to summarize, I want "enter" or "return" to commit the field and run the script. The script is exiting with "false" which tells FMP to reverse the change. Try it with "true".
May 22, 201213 yr Author Thanks for your replies, The article is useful, but it's a different application of keystrokes. I think I used exit script [result:false] incorrectly, but that's as much as I can glean. I tried the exit script [result: true], and it's the same issue, that it doesn't commit the change. I think the problem is that the allocate script goes to a different layout, at which point the selected text in the dropdown is cleared, so by the time exit script [result:false] runs, the field is already cleared. I could have the allocate script run in a new window, which might fix that, but I'd prefer not to alter that script, since it's long, complicated, and not something I created. Any further thoughts?
Create an account or sign in to comment