dbTalk Databases Forums  

Activating a script from within a record?

comp.databases.filemaker comp.databases.filemaker


Discuss Activating a script from within a record? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Emma Grey
 
Posts: n/a

Default Activating a script from within a record? - 12-09-2006 , 09:18 PM






Hi gurus, I have a little problem I'd be grateful for your advice on.

I'm building a db and I will need to activate (on demand) a unique
applescript from within each record. If this were a defined button on a
page layout, this would be simple and I'd need no help. But how do I do
that within a record (there will be way too many scripts to have layout
buttons for each).

Is there a way of ... perhaps ... having a field that contains the text
of the applescript, and then have a button that activates that
particular field/script? Or another solution altogether?

I've done a little research, like the Help URL, but can't find anything
useful.

Thanks

Emma

Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: Activating a script from within a record? - 12-09-2006 , 10:13 PM






My own reaction to your question - while though I don't really understand
it - is that when one reaches a wall in FileMaker, it's most probably
because its database design is wrong.
Why don't you simply describe the application you want to setup to leave us
a chance to propose other solutions to address it ?
Your 'one Applescript per record' approach seems badly convoluted to me.
Maube others would understand what you ask better than me, though.
Remi-Noel

"Emma Grey" <gone (AT) way (DOT) far> a écrit dans le message de news:
101220061418168540%gone (AT) way (DOT) far...
Quote:
Hi gurus, I have a little problem I'd be grateful for your advice on.

I'm building a db and I will need to activate (on demand) a unique
applescript from within each record. If this were a defined button on a
page layout, this would be simple and I'd need no help. But how do I do
that within a record (there will be way too many scripts to have layout
buttons for each).

Is there a way of ... perhaps ... having a field that contains the text
of the applescript, and then have a button that activates that
particular field/script? Or another solution altogether?

I've done a little research, like the Help URL, but can't find anything
useful.

Thanks

Emma



Reply With Quote
  #3  
Old   
Ursus
 
Posts: n/a

Default Re: Activating a script from within a record? - 12-10-2006 , 02:52 AM



Emma,

You can (sort of) conquer this by using a combination of techniques. First
start by downloading and installing the free plug-in: EventScript by
Softs4Humans

Then set up your solution as follows. But basicaly I agree with Remi-Noel,
that when you get hundreds of different scripts to execute there might be
something flawed in your design.

With EvenScript enabled create the following.
A valuelist <NavList>
A global <gNavigation>
A Script <Nav>

In NavList are the (short) descriptions of navigating action you want to
take (or script you might want to perform)

Open Pic

The gNavigation field is set to auto-enter, calculated value
[S4HU_EventScript( Get ( FileName ); "NAV" ; gNav)]
The field is put on a layout, display as popup-menu (NOT anything else),
display values from NavList
the Nav script contains something like this. The ScriptParameters are the
same as the values as in your value list.

If [ Get ( ScriptParameter ) = "Open pic" ]
Open URL [ kerken::gMapopen ][ No dialog ]
Else If [ Get ( ScriptParameter ) = "Foto Layout" ]
Go to Layout [ "Foto" ]
Perform Script [ "To Tab"; Parameter: Let ( $$_active_tab = 1 ; 1 ) ]
Else If [ Get ( ScriptParameter ) = "Streets" ]
Perform Script [ "Open City Map" ]
Else If [ Get ( ScriptParameter ) = "Books" ]
Go to Layout [ "Books" (Books) ]
End If

That should give you enough to work with.


Ursus


"Emma Grey" <gone (AT) way (DOT) far> schreef in bericht
news:101220061418168540%gone (AT) way (DOT) far...
Quote:
Hi gurus, I have a little problem I'd be grateful for your advice on.

I'm building a db and I will need to activate (on demand) a unique
applescript from within each record. If this were a defined button on a
page layout, this would be simple and I'd need no help. But how do I do
that within a record (there will be way too many scripts to have layout
buttons for each).

Is there a way of ... perhaps ... having a field that contains the text
of the applescript, and then have a button that activates that
particular field/script? Or another solution altogether?

I've done a little research, like the Help URL, but can't find anything
useful.

Thanks

Emma



Reply With Quote
  #4  
Old   
Emma Grey
 
Posts: n/a

Default Re: Activating a script from within a record? - 12-10-2006 , 04:45 AM




Thanks to Remi-Noel and Ursus for your comments. I'll take both pieces
of advice: see if my design is sound, and then try this approach.

Thanks for your help.

Emma



In article <457bcab3$0$64262$dbd4d001 (AT) news (DOT) wanadoo.nl>, Ursus
<ursus.kirk (AT) wanadoo (DOT) nl> wrote:

Quote:
Emma,

You can (sort of) conquer this by using a combination of techniques. First
start by downloading and installing the free plug-in: EventScript by
Softs4Humans

Then set up your solution as follows. But basicaly I agree with Remi-Noel,
that when you get hundreds of different scripts to execute there might be
something flawed in your design.

With EvenScript enabled create the following.
A valuelist <NavList
A global <gNavigation
A Script <Nav

In NavList are the (short) descriptions of navigating action you want to
take (or script you might want to perform)

Open Pic

The gNavigation field is set to auto-enter, calculated value
[S4HU_EventScript( Get ( FileName ); "NAV" ; gNav)]
The field is put on a layout, display as popup-menu (NOT anything else),
display values from NavList
the Nav script contains something like this. The ScriptParameters are the
same as the values as in your value list.

If [ Get ( ScriptParameter ) = "Open pic" ]
Open URL [ kerken::gMapopen ][ No dialog ]
Else If [ Get ( ScriptParameter ) = "Foto Layout" ]
Go to Layout [ "Foto" ]
Perform Script [ "To Tab"; Parameter: Let ( $$_active_tab = 1 ; 1 ) ]
Else If [ Get ( ScriptParameter ) = "Streets" ]
Perform Script [ "Open City Map" ]
Else If [ Get ( ScriptParameter ) = "Books" ]
Go to Layout [ "Books" (Books) ]
End If

That should give you enough to work with.


Ursus


"Emma Grey" <gone (AT) way (DOT) far> schreef in bericht
news:101220061418168540%gone (AT) way (DOT) far...
Hi gurus, I have a little problem I'd be grateful for your advice on.

I'm building a db and I will need to activate (on demand) a unique
applescript from within each record. If this were a defined button on a
page layout, this would be simple and I'd need no help. But how do I do
that within a record (there will be way too many scripts to have layout
buttons for each).

Is there a way of ... perhaps ... having a field that contains the text
of the applescript, and then have a button that activates that
particular field/script? Or another solution altogether?

I've done a little research, like the Help URL, but can't find anything
useful.

Thanks

Emma



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.