Re: Tracking a script's progress (was renaming files in Finder)
Re: Tracking a script's progress (was renaming files in Finder)
- Subject: Re: Tracking a script's progress (was renaming files in Finder)
- From: Kai Edwards <email@hidden>
- Date: Sat, 16 Feb 2002 22:49:25 +0000
on Mon, 4 Feb 2002 15:13:38 EST, email@hidden wrote:
>
I won't be presumptuous, so I will also suggest opening the event and result
>
windows in the script editor when you run it, so you can see where it gets to
>
before it bogs. To help troubleshoot, consider putting in dialog boxes
>
(display dialog "Made it to the handler", display dialog "sucessfully reset
>
all the names", etc.), so you know where it gets to.
As with so many things, identifying a problem is halfway to solving it.
(Even if one has to ask for help, much of the process of elimination will
then already be done.)
The following suggestion will be rudimentary to many but - for the benefit
of any newcomers - I've found it an invaluable troubleshooting tool since I
first found it:
If you're already using the event window to check progress, you could use
<log> as an alternative to the more 'intrusive' <display dialog>. You can
also use <log> to evaluate stages that may not normally be displayed in the
event window. For example:
------------------------------------
repeat with x from 1 to 10
log x
end repeat
------------------------------------
or:
------------------------------------
repeat with x from 1 to 10
log (x as string) & " is " & {"even", "odd"}'s item ((x mod 2) + 1)
end repeat
------------------------------------
or:
------------------------------------
try
"hello" as integer --produces error
on error msg number num
log "Error " & num & ": " & msg
end try
------------------------------------
Kai
--
**********************************
Kai Edwards Creative Resources
1 Compton Avenue Brighton UK
Telephone +44 (0)1273 326810
**********************************
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.