Get currently executing line number of script as a variableI'd like to send progress messages to the log that include the currently executing line number of the script. If I never changed the script of course I could just hard-code the line number into the message. But when I add/delete lines in the course of editing, the line numbers change. So is there a function that gives you the currently executing line number, so I could incorporate something like
Write("The script has now progressed to line number ", CurrentlyExecutingLine())Automation and ScriptingRe: Get currently executing line number of script as a variableIt doesn't appear this is an option, but perhaps this workaround will do the trick for you. Put the entire text of the script into a variable at the beginning of the script. First line could be something like
script_text = Load Text File( "Path\script.jsl" );
Then, whenever you want to tell the user what line is executing,
//marker001
Write( "The script has now progressed to line number ", Contains( Words( script_text, "\!N" ), "//marker001" ) + 1 );
Just make sure "//marker###" is the only text on its line.
Re: Get currently executing line number of script as a variableThanks. You'll admit, I'm sure, that it's kluge-y. But it's definitely clever!