Below is a script template that you should consider using to unify the appearance of scripts throughout Linkinus. The parameter in “linkinuscmd()” is optional and may be removed by you.
-- Script Name: … -- Version: … -- Description: … -- Author: … on linkinuscmd(parameter) … end linkinuscmd -- Changelog: -- X.Y: -- - … -- - … -- C.V:
You can use PHP for your scripts. You need “extscript” to run the php-files.
Perhaps you need to update the “extscript”. If so, you have to update the two file paths to Linkinus 2:
set p to p & "Linkinus 2/Scripts/External/" set test to searchReplace((alias (a as string)) & "Linkinus 2:Scripts:External:", "::Linkinus", "")
Everything else is explained in the section about extscript.
You can then use echo to send something to the chat. Use something like the following for debugging. Nothing will be send to the chat then, just shown to you like explained in the section debugging echo
ob_start(); echo '/debug echo '; print_r( $argv ); // echo '1' . "\r\n"; echo ob_get_clean();
If you add there Lines to the extscript, you can pass additional parameters to your $argv Array in PHP:
set AppleScript's text item delimiters to " " set scriptName to get first text item of parameter set argv to searchReplace(parameter, scriptName & "", "")
Notice: I renamed scriptName in the handler to parameter!