Tuesday, September 16, 2014

#1 2009-03-25 08:48:49 am

Nigel Garvey
Moderator
From: Warwickshire, England
Registered: 2002-11-19
Posts: 3513

Script Editor 2.0: opening scripts that end with a one-line 'if'

Script Editor 2.0 won't open a compiled script file on the first attempt if the last line of the script is a one-line 'if' statement and one or more of the following is true:

The 'if' condition is an expression rather than a direct boolean value, or:
The conditionally executed code contains another 'if' statement, or:
The conditionally executed code contains an application specifier.

The file opens on the second attempt, but the resulting Script Editor window has the name "Window" instead of the name of the file.

If the text of such a script has not yet been compiled, or has not yet been recompiled after an edit, running it in Script Editor 2.0 (if that's something you're likely to do) only effects the compilation. A second Run is needed to run it.

Work-rounds include:

Rewriting the last line of the script as a multi-line statement.
Splitting the line with a continuation character.
Putting a comment line or more than one blank line after the last line.

This bug is only known to affect Script Editor 2.0 and its sub-versions and has existed since the days of Jaguar.

Thanks to Sean Zhu for noticing the problem and raising it in the OS X forum.

Last edited by Nigel Garvey (2009-03-26 04:08:59 pm)


NG

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.027 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)