ScriptTrigger ( )

Function stats

Average user rating
4.3333
37
123
9999
Support
FileMaker 8.0 +
Date posted
07 December 2008
Last updated
14 May 2009
Version
Recursive function
No

Author Info
 Fabrice

38 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

ScriptTrigger  ( _scriptName;   _scriptParameter;   _fileName;   _scriptControl )


Parameters

_scriptName  


_scriptParameter  


_fileName  leave empty (


_scriptControl  leave empty (


Description

Tags:  Script   plug in  

Using this function makes it easier the day you decide to change plug-in. zippScript and DoScript are supported, but any script triggerring plug-in could be.
/!\ Both plug-ins need to be installed while copying this CF to your file.

- Check one of the plug-in is installed
- Triggers a script through DoScript, zippScript
- Controls that scripts are correctly named with _DNR (Do Not Rename)

Examples

Sample input

ScriptTrigger ( "myScript_DNR" ; "myParameter" ; "" ; "" )


Sample output

triggers myScript

 

Function code

/* ScriptTrigger ( _scriptName ; _scriptParameter ; _fileName ; _scriptControl )

by Fabrice Nordmann

v.1.3 - 11 Mar 2008 - removed EventScript, removed Evaluations to secure the process.
v.1.2 - 10 Jan 2008 - initialise $$ERROR_ScriptTrigger
v.1.1 - 27 Dec 2007
v.1 - 09 Nov 2007

Using this function makes it easier the day you decide to change plug-in. zippScript and DoScript are supported, but any script triggerring plug-in could be.
/!\ Both plug-ins need to be installed while copying this CF to your file.

- Check one of the plug-in is installed
- Triggers a script through DoScript, zippScript
- Controls that scripts are correctly named with _DNR (Do Not Rename)
*/

// DECLARE VARIABLES
Let ([
$cf_scriptName = _scriptName
; $cf_scriptParameter = _scriptParameter
; $cf_fileName = Case ( IsEmpty ( _fileName ) ; Get ( FileName ) ; _fileName )
; $cf_scriptControl = Case ( IsEmpty ( _scriptControl ) ; "pause" ; _scriptControl )
; $$_ERROR_ScriptTrigger = ""
] ; "" )

&
// DECLARE $$ScriptTriggerPlugin

Case ( IsEmpty ( $$ScriptTriggerPlugin )
; Let ( $$ScriptTriggerPlugin =
Case (
not EvaluationError ( "mFMb_DoScript_Version ( 1 )" ) ; "DoScript"
; not EvaluationError ( "zippScript_Version" ) ; "zippScript"
; 0
)
; "" )
)

&

// ERRORS
Let ( $$_ERROR_ScriptTrigger =
Case (
IsEmpty ( $cf_scriptName ) ; "ERROR - no script name was specified"
; not PatternCount ( ¶ & ScriptNames ( $cf_fileName ) & ¶ ; ¶ & $cf_scriptName & ¶ ) ; "ERROR - Script \"" & $cf_scriptName & "\"not found in " & $cf_filename
; Right ( $cf_scriptName ; 4 ) <> "_DNR" ; "ERROR - script suffix should be _DNR (" & $scriptName & ")"
; $$ScriptTriggerPlugin = 0 ; "ERROR - Plugin not installed"
)
; "" )

&

// TRIGGER SCRIPT
Case (
$$ScriptTriggerPlugin = "DoScript" ; mFMb_DoScript ( $cf_scriptName ; $cf_fileName ; $cf_scriptParameter ; $cf_scriptControl )
; $$ScriptTriggerPlugin = "zippScript" ; zippScript_PerformScript( $cf_fileName ; $cf_scriptName ; $cf_scriptParameter ; $cf_scriptControl )
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/123

    Prototype: ScriptTrigger( _scriptName; _scriptParameter; _fileName; _scriptControl )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 14 May 2009
    Version: 1.2

*/
// ===================================

 

Comments

Hayri
08 March 2010



mFMb_DoScript****** ( ********$cf_scriptName ; $cf_fileName ; $cf_scriptParameter ; $cf_scriptControl )

There is a problem in this ****** ( ********
dont access in windows
(Edited by Hayri on 08/03/10 )
  General comment

 

 


Login or register to comment

Create a new account with fmcustomfunctions.com or login to post a comment.

 

 

 

Top Tags

Text Parsing  (24)
List  (19)
XML  (15)
Format  (14)
Date  (14)
Debug  (12)
Layout  (11)
Variables  (10)
Filter  (9)
ValueIterator  (6)
Layout Objects  (6)
Number  (5)
Recursive  (5)
Dev  (5)
Interface  (5)
Text  (5)