APSF,0 //################################################################################ // Name : Launch Editor // Purpose : Launch and external editor // Requires: AP v1.5.1 or above // Author : Robin Lauryssen-Mitchell // Date : 31st July 2006 // Version : 1.0 // Status : Production // History : 20060731 - 0.1 - Internal testing only // 20060731 - 1.0 - Production release // Notes : This script will only work with editors that will accept a file name // passed as a shell parameter. // // THE VALUE ASSIGNED TO cEditorPath IS FOR DEMONSTRATION PURPOSES. // You should change this value to 'point' to your preferred editor. // For example, on my system, I quite often like to use NotePad++. // For this I would use the following: // const cEditorPath = "C:\Program Files\Editors\Notepad++\notepad++.exe" // // Personally I use this to edit a script that can be run from the // script menu. That way the Scripts dialogue does not need to be open. // This reduces the possibilty for confusion about which editor should // be used. Of course this script should also be run from the Script // menu. // // To quickly access the 'AstroPlanner Scripts' directory I created a // shortcut to the directory on my desktop (WindowsXP). Not sure how to // do similar with a Mac. This is because GetFilePath always defaults // to the root of the primary drive (usually C: on Windows systems). // // If you have a couple (or more) favourite editors then it would be // possible to modify this script to include an Editor Selection // at the beginning. //################################################################################ //******************************************************************************** // Declarations //******************************************************************************** //================================================================================ // Const declarations //================================================================================ const cDialogueTitle = "Select file to edit" //Title for file selection dialogue const cEditorPath = "c:\windows\notepad.exe" //Path to favourite script editor const cEmptyFilePath = "" //GetFilePath value if cancelled //================================================================================ // Var declarations //================================================================================ dim FilePath as string //File to be edited (empty if dialogue is cancelled) dim ShellText as string //Text returned by Shell command (should be none!) //******************************************************************************** // Main Code //******************************************************************************** FilePath = GetFilePath(cDialogueTitle) //Get the user selected file path if FilePath <> cEmptyFilePath then //If FilePath is not empty then ... ShellText = Shell(cEditorPath, FilePath) //...execute the required editor end if