Post

Replies

Boosts

Views

Activity

Reply to Progress bar issues
The first thing would probably be to not use exceptions for flow control. You don’t mention how you are calling the shell command or how you are handling the progress bar stop button, but if you are using NSTask, you can keep track of it (property, etc). Then the task can be terminated immediately in the stop button handler before performing the normal progress bar dismissal.
May ’21
Reply to Complete AppleScript Language Dictionary
Those terms are not part of the AppleScript language itself, so you aren’t going to find them in the AppleScript Language Guide (although they are available from the System Events processes suite).  You can use something like the Accessibility Inspector application (included with Xcode) to find which terms are used for any given UI element - the terms themselves are defined in macros or constants in the various Cocoa frameworks, such as Application Services.
Mar ’21
Reply to Applescript defining "result" as a variable
In AppleScript, control statements such as if are not expressions and do not return results - until a statement that yields a result is executed, the value of the built-in result property is undefined. You shouldn't rely on the value of the result property remaining stable across multiple statements - in this case, when executing the if x = 4 statement in the repeat loop, the property is getting cleared.  This kind of issue can be avoided by explicitly setting your own variable to a value to test, for example set myResult to button returned of (display dialog "whatever").
Oct ’20
Reply to script editor
When using the repeat with X in Y form of the repeat statement, the loop variable X is actually a reference to an item in the list Y. Depending on what you are doing with the variable X, the value may not be dereferenced (yet), so comparisons can fail. To be sure you are using the value of X instead of its reference, you can coerce it to the desired class or get its contents, for example:if contents of X = "whatever" then somethingAlso note that index is reserved word (note the different font in the Script Editor), and may result in unexpected behavior if used as a variable name.(Edit: ninja'd by hhas01)
May ’20