Editing a script behind a button

Editing a script behind a button

am 28.11.2007 00:38:19 von Rick Altman

Advancing age has made necessary the following maneuver:

1. I want to change how a button behaves, but I don't remember which script
is attached to the button.

2. So I switch to Layout view, double-click the button, click Specify, just
to see the name of the script associated with it.

3. Switch back to Browse and head to the Scripts dialogs to make the change.


Any way to find the script attached to a button without Step No. 2?





Rick A.
Pleasanton CA

Re: Editing a script behind a button

am 28.11.2007 06:23:57 von Helpful Harry

In article , "Rick
Altman" wrote:

> Advancing age has made necessary the following maneuver:
>
> 1. I want to change how a button behaves, but I don't remember which script
> is attached to the button.
>
> 2. So I switch to Layout view, double-click the button, click Specify, just
> to see the name of the script associated with it.
>
> 3. Switch back to Browse and head to the Scripts dialogs to make the change.
>
> Any way to find the script attached to a button without Step No. 2?

Nope. The button is defined to run the script, so the only way to know
what script is to check the button's definition window.

Of course, the sensible option would be to name your scripts and
buttons with the same text. :o)
eg.
Button says "Print Labels" and runs the "Print Labels" script


The sillier option would be to go through ALL the scripts adding a
first line of:

Display Message [{type in script name}]

then whenever you click a button a message window will be displayed to
tell you which script it is.

The slightly less silly version of this technique would be to make
Shift-clicking the button display the message while simply clicking
doesn't ... but it's still way more long winded than using the same
name or looking in the definition window (unless perhaps you're
starting a brand new database). Some people do use this Shift-Click
technique to add a "Help" message to butons, which can be useful.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Editing a script behind a button

am 28.11.2007 09:34:55 von ursus.kirk

>> Any way to find the script attached to a button without Step No. 2?
>
> Nope. The button is defined to run the script, so the only way to know
> what script is to check the button's definition window.
>
> Of course, the sensible option would be to name your scripts and
> buttons with the same text. :o)
> eg.
> Button says "Print Labels" and runs the "Print Labels" script
>
>
> The sillier option would be to go through ALL the scripts adding a
> first line of:
>
> Display Message [{type in script name}]
>
> then whenever you click a button a message window will be displayed to
> tell you which script it is.
>
> The slightly less silly version of this technique would be to make
> Shift-clicking the button display the message while simply clicking
> doesn't ... but it's still way more long winded than using the same
> name or looking in the definition window (unless perhaps you're
> starting a brand new database). Some people do use this Shift-Click
> technique to add a "Help" message to butons, which can be useful.

With the newer versions of FM you can add tooltips to objects. Normaly used
for short info on what the object does. But you might also stick the name of
the script to run in it.

Keep well, Ursus

Re: Editing a script behind a button

am 28.11.2007 16:02:42 von Rick Altman

Could you please tell me more about Shift+Click? I am not aware of such an
option in FM...



RA





"Helpful Harry" wrote in message
news:281120071823573240%helpful_harry@nom.de.plume.com...
>
> Of course, the sensible option would be to name your scripts and
> buttons with the same text. :o)
> eg.
> Button says "Print Labels" and runs the "Print Labels" script
>
>
> The sillier option would be to go through ALL the scripts adding a
> first line of:
>
> Display Message [{type in script name}]
>
> then whenever you click a button a message window will be displayed to
> tell you which script it is.
>
> The slightly less silly version of this technique would be to make
> Shift-clicking the button display the message while simply clicking
> doesn't ... but it's still way more long winded than using the same
> name or looking in the definition window (unless perhaps you're
> starting a brand new database). Some people do use this Shift-Click
> technique to add a "Help" message to butons, which can be useful.
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Editing a script behind a button

am 28.11.2007 19:20:58 von ursus.kirk

"Rick Altman" schreef in bericht
news:IKidnWvTQ9aoHtDanZ2dnUVZ_oytnZ2d@comcast.com...
> Could you please tell me more about Shift+Click? I am not aware of such an
> option in FM...

You can change the functions of any button. Look in the helpfile for:
Get(ActiveModifierKeys) function

Keep well, Ursus

Re: Editing a script behind a button

am 28.11.2007 19:29:19 von Christoph Bouthillier

"Rick Altman" schreef in bericht
news:IKidnWvTQ9aoHtDanZ2dnUVZ_oytnZ2d@comcast.com...
> Could you please tell me more about Shift+Click? I am not aware of such an
> option in FM...
>
>

Hello Rick,

With Get(ActiveModifierKeys)=... you can check for various key combinations.
If you e.g. choose 12, then Ctrl + Alt + Click will be recognized; I use
that on each layout on a hidden tiny button to unlock the status area which
should be barred to the user but not to me.

Shift = 1

Caps Lock = 2

Ctrl (Windows) and Control (Mac OS) = 4

Alt (Windows) and Option (Mac OS) = 8

(Mac OS) = 16



Ctrl = 4
Alt = 12
makes 12
;=)


Met vriendelijke groet / Mit freundlichen Gruessen / With kind regards
Christoph Bouthillier
p o s t <> oh-no-spam t e k s t o t a a l << d o t >> c o m
Forget the oh-no-spam



Re: Editing a script behind a button

am 28.11.2007 21:00:15 von Helpful Harry

In article <54e03$474db3a4$59dc4456$29223@news.speedlinq.nl>,
"Christoph Bouthillier" wrote:

> "Rick Altman" schreef in bericht
> news:IKidnWvTQ9aoHtDanZ2dnUVZ_oytnZ2d@comcast.com...
> >
> > Could you please tell me more about Shift+Click? I am not aware of such an
> > option in FM...
>
> Hello Rick,
>
> With Get(ActiveModifierKeys)=... you can check for various key combinations.
> If you e.g. choose 12, then Ctrl + Alt + Click will be recognized; I use
> that on each layout on a hidden tiny button to unlock the status area which
> should be barred to the user but not to me.
>
> Shift = 1
>
> Caps Lock = 2
>
> Ctrl (Windows) and Control (Mac OS) = 4
>
> Alt (Windows) and Option (Mac OS) = 8
>
> (Mac OS) = 16
>
>
>
> Ctrl = 4
> Alt = 12
> makes 12
> ;=)


Yep. So you button's script might look something like:

If [Get(ActiveModifierKeys) = 1]
** do Shift-click script stuff **
Exit Script
End If
If [Get(ActiveModifierKeys) = 12]
** do Cltrl-Alt-click script stuff **
Exit Script
End If
** do normal click script stuff **


Simply use a separate If-End If section (or of course separate
sub-scripts) to hold the script commands for any key combinations you
want.

Pu the normal click script commands at the end without an If-End If so
that these will also be run if the user tries a key combination you
aren't bothered about.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Editing a script behind a button

am 29.11.2007 20:39:47 von Jens Teich

If you use FileMaker Advanced, you can turn on the script debugger and
click the button. The debugger shows the name of the script.

-jens