Your first script is correct, however it will work only if the job is triggered by a semaphore file. If you run the job manually it will fail because the @V"file" macro-parameter will not be replaced and this will cause the script syntax error. To check how the job has started use FileExists statement with the same file name or file mask that you used in the job trigger definition. If it returns True you can branch script logic to execute statements using @V"file" macro-parameter othe wise you would job to prtion of the script intended for manual job run. If you don't want to hard code the file names you can do the following Dim strSemFiles, string Dim bFound, boolean JobDescribe( @V"job_id", "FILE", strSemFiles ) FileExists( strSemFiles, bFound ) If( bFound, GOTO_AUTO_RUN_LABEL, GOTO_MANUAL_RUN_LABEL ) GOTO_AUTO_RUN_LABEL: ... GOTO_MANUAL_RUN_LABEL: ... : I'm trying to use the @V"file" macro to find out if the job was : initiated by semaphore files or started manually by clicking on "Run : Now" but I keep getting syntax errors regardless of how I try to use : it. : I have tried: Dim strMsg, string : ConcatEx("Files that initiated this job ", : "@V"file"", strMsg) : LogAddMessageEx( "INFO", @V"job_id", : "@V"job_name"", strMsg) : and: Dim strMsg, string : ConcatEx("Files that initiated this job ", @V"file", : strMsg) : LogAddMessageEx( "INFO", @V"job_id", : "@V"job_name"", strMsg) : I can't find any examples of how to use this macro. If I change it to : @V"job_name" I don't get syntax errors so it is something about : the "file" macro. : Help!?
|