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
*/
// ===================================
/* ScriptTrigger ( _scriptName ; _scriptParameter ; _fileName ; _scriptControl ) __LITBR____LITBR__by Fabrice Nordmann__LITBR____LITBR__v.1.3 - 11 Mar 2008 - removed EventScript, removed Evaluations to secure the process.__LITBR__v.1.2 - 10 Jan 2008 - initialise $$ERROR_ScriptTrigger__LITBR__v.1.1 - 27 Dec 2007__LITBR__v.1 - 09 Nov 2007__LITBR____LITBR__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.__LITBR__/!\ Both plug-ins need to be installed while copying this CF to your file.__LITBR____LITBR__- Check one of the plug-in is installed__LITBR__- Triggers a script through DoScript, zippScript__LITBR__- Controls that scripts are correctly named with _DNR (Do Not Rename)__LITBR__*/__LITBR____LITBR__// DECLARE VARIABLES__LITBR__Let ([__LITBR__ $cf_scriptName = _scriptName__LITBR__ ; $cf_scriptParameter = _scriptParameter__LITBR__ ; $cf_fileName = Case ( IsEmpty ( _fileName ) ; Get ( FileName ) ; _fileName )__LITBR__ ; $cf_scriptControl = Case ( IsEmpty ( _scriptControl ) ; "pause" ; _scriptControl )__LITBR__ ; $$_ERROR_ScriptTrigger = ""__LITBR__] ; "" )__LITBR____LITBR__&__LITBR__// DECLARE $$ScriptTriggerPlugin__LITBR____LITBR__Case ( IsEmpty ( $$ScriptTriggerPlugin )__LITBR__ ; Let ( $$ScriptTriggerPlugin = __LITBR__ Case (__LITBR__ not EvaluationError ( "mFMb_DoScript_Version ( 1 )" ) ; "DoScript"__LITBR__ ; not EvaluationError ( "zippScript_Version" ) ; "zippScript"__LITBR__ ; 0__LITBR__ )__LITBR__ ; "" )__LITBR__)__LITBR____LITBR__&__LITBR____LITBR__// ERRORS__LITBR__Let ( $$_ERROR_ScriptTrigger = __LITBR__Case (__LITBR__ IsEmpty ( $cf_scriptName ) ; "ERROR - no script name was specified"__LITBR__ ; not PatternCount ( ¶ & ScriptNames ( $cf_fileName ) & ¶ ; ¶ & $cf_scriptName & ¶ ) ; "ERROR - Script \"" & $cf_scriptName & "\"not found in " & $cf_filename__LITBR__ ; Right ( $cf_scriptName ; 4 ) <> "_DNR" ; "ERROR - script suffix should be _DNR (" & $scriptName & ")"__LITBR__ ; $$ScriptTriggerPlugin = 0 ; "ERROR - Plugin not installed"__LITBR__)__LITBR__; "" )__LITBR____LITBR__&__LITBR____LITBR__// TRIGGER SCRIPT__LITBR__Case ( __LITBR__ $$ScriptTriggerPlugin = "DoScript" ; mFMb_DoScript ( $cf_scriptName ; $cf_fileName ; $cf_scriptParameter ; $cf_scriptControl )__LITBR__ ; $$ScriptTriggerPlugin = "zippScript" ; zippScript_PerformScript( $cf_fileName ; $cf_scriptName ; $cf_scriptParameter ; $cf_scriptControl )__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/123__LITBR____LITBR__ Prototype: ScriptTrigger( _scriptName; _scriptParameter; _fileName; _scriptControl )__LITBR__ Function Author: Fabrice (http://www.fmfunctions.com/mid/37)__LITBR__ Last updated: 14 May 2009__LITBR__ Version: 1.2__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
08 March 2010
There is a problem in this ****** ( ********
dont access in windows
(Edited by Hayri on 08/03/10 )