Re: tabs to spaces
Re: tabs to spaces
- Subject: Re: tabs to spaces
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 2 Dec 2008 01:34:21 -0500
On Tue, Dec 2, 2008 at 1:23 AM, Scott Haneda <email@hidden> wrote:
> I am a little confused about TID's. Why all this setting, resetting, and
> restoring? If within the same script, I do not see why you need to. Is it
> to be said, a TID that is set, is set that way, and stored that way even
> after the script has finished execution?
No. If you just have a standalone script, you don't need to reset.
But if you have a larger app it's a good habit to avoid surprises when
one part leaves the TID's in an unexpected state.
> What is the rows var that is sitting at the end about? Is this just a way
> to debug so I can see output in Script Editor?
It's the return value of the script. If you run it in Script Editor,
then it'll be displayed as the result.
> Actually, this brings up a nice issue, how do you write print/echo
> statements to end up in the output window of Script Editor? Right now, I
> use display dialog, but that gets old, clicking OK, in a repeat loop that is
> large.
There's a "log" statement that sends output to the log tab. There's
no way to write directly to the output window (or to stdout from
osascript) other than building up a long string and returning it at
the end.
> Maybe I need a better editor, but I am not aware of one.
Script Debugger and Smile are the standard alternatives to Script Editor.
> So then I went with
> the end of foo style, but in research, read that was massively slow,
> compared to working on a "copy" or "reference", at which point, I thought
> best to come here and chat it up a bit.
set end modifies the list in place, which is much faster than making
and modifying a copy. However, if you access the list via a property
that holds a reference to it, you will see a performance improvement.
Search for speedup tips in the archive of this mailing list; there's
some weird stuff that makes a big difference for no obvious reason.
> So I can set TID's to "somestring" and it will use that as the seperator?
Yes, any string. The names return, space, tab etc. are just global
convenience variables whose values are the respective named
one-character strings.
> Can you give me some function names to start searching on? My current
> searches are only yielding results relating to AS dicts within an app, but
> not as a standalone text modifier within a scripts return result.
Search for "styled text" and applescript.
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden