• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript TID bug OS 10.2.5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript TID bug OS 10.2.5?


  • Subject: Re: AppleScript TID bug OS 10.2.5?
  • From: John Delacour <email@hidden>
  • Date: Thu, 24 Apr 2003 15:27:00 +0100
  • Mac-eudora-version: 6.0a16

At 8:29 am -0400 24/4/03, Bill Cheeseman wrote:

on 03-04-24 8:00 AM, John Delacour at email@hidden wrote:

It is also quite unnecessary to say "Applescript's....."

This seems to be true as a practical matter these days, but is it entirely
safe?
[....]
In those days, the Scriptable Text Editor also had a 'text item delimiters"
property. If you wanted to use AppleScript's text item delimiters property
with a tell block targeted at STE, you had to use "AppleScript's text item
delimiters".

In order to make things 100% "safe" I normally use

set MY text item delimiters to A_STRING

since Applescript does not recognise a list of delimiters
as this demonstrates

set text item delimiters to {"$", "#"}
text items of "6#7$8"
{"6#7", "8"}

STE behaves as it should.

1. It REQUIRES a list and will ignore a string.
2. It will accept multiple delimiters of 0-2 characters per item

tell app "Scriptable Text Editor"
JJJJJJ set the text of the front window to "6#7$8"
JJJJJJ set its text item delimiters to {"$", "#"}
JJJJJJ get text items in the text of the front window
end
{"6", "7", "8"}

It is therefore possible to try to set (Applescript's) text item delimiters even within a STE tell block, even without my or its:

set my text item delimiters to "@"
tell application "Scriptable Text Editor"
set its text item delimiters to "."
text items of "a.b.c" --> {"a.b.c"}
set text item delimiters to "."
text items of "a.b.c" --> {"a.b.c"}
tell me to return text items of "a.b.c" --> {"a.b.c"}
end tell
text items of "a@b@c" --> {"a", "b", "c"}

You can play with this using different options, such as 'tell me to' but the bottom line is really that 'set MY text item delimiters to A_STRING' is going to work in all cases and not even conflict with STE, which is a thoroughly fine piece of work and downloadable from the URI below. All those polluted with current trends in Applescript ought to get it, as well as Language at a Glance.

<http://www.bd8.com/scripting/downloads/>

JD
_______________________________________________
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.

References: 
 >Re: AppleScript TID bug OS 10.2.5? (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: calling a Classic osax from X
  • Next by Date: Re: Trouble at the mill ...
  • Previous by thread: Re: AppleScript TID bug OS 10.2.5?
  • Next by thread: Re: AppleScript TID bug OS 10.2.5?
  • Index(es):
    • Date
    • Thread