Line Numbering in Script Editor

Posted on
Thu May 11, 2023 7:47 am
SearchCz offline
Posts: 172
Joined: Sep 18, 2019

Line Numbering in Script Editor

Sometimes I see scripting errors in the activity log, with references to the approximate line number on which the error occurred. Like this:

Script Error around line 4 - "aDuration = str(xMinutes)f"


"Around line 4" is easy enough to manage, but when its "around line 123" that's aa little harder. Line numbering in the script editor would sure help with that.

Posted on
Thu May 11, 2023 7:57 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Line Numbering in Script Editor

That would be helpful for sure, but what I do is copy the script into another editor like BBEdit (basic version is free) and use that to identify the offending line. Another more advanced tool is Visual Studio which is also free and that will also help identify problems.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu May 11, 2023 12:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Line Numbering in Script Editor

FWIW, I think a script that is large enough to require tracking down issues using line numbers should probably be run as a separate script file. Text editors geared to writing code are much better for developing scripts in general, and the longer/more complex a script gets the better an external editor will serve you in a variety of ways.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 11, 2023 1:47 pm
SearchCz offline
Posts: 172
Joined: Sep 18, 2019

Re: Line Numbering in Script Editor

jay (support) wrote:
FWIW, I think a script that is large enough to require tracking down issues using line numbers should probably be run as a separate script file. Text editors geared to writing code are much better for developing scripts in general, and the longer/more complex a script gets the better an external editor will serve you in a variety of ways.


I'll try it !

Should I expect any change in performance holding the script in an external file?

Posted on
Thu May 11, 2023 3:48 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Line Numbering in Script Editor

SearchCz wrote:
Should I expect any change in performance holding the script in an external file?


Nope.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 11, 2023 4:01 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Line Numbering in Script Editor

Two other bonus features with linked scripts are that they run in their own process, and they're not subjected to the 10-second time limit (like embedded scripts are).

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests