Re: Remove spaces [was: applescript-users digest, Vol 3 #1785 - 10 msgs]
Re: Remove spaces [was: applescript-users digest, Vol 3 #1785 - 10 msgs]
- Subject: Re: Remove spaces [was: applescript-users digest, Vol 3 #1785 - 10 msgs]
- From: Kai <email@hidden>
- Date: Sun, 29 Jun 2003 13:58:20 +0100
on Fri, 27 Jun 2003 08:58:05 +0200, Bernard Azancot wrote:
>
Le vendredi, 27 jun 2003, ` 07:00 Europe/Paris,
>
email@hidden a icrit :
>
>
> Sounds like Bernard may have inserted the code into a tell "Tex-Edit Plus"
>
> block:
>
>
YES SIR !
>
GOOD GUESS SIR !
>
>
As newbie I would be delightetd to learn when this "AppleScript's"
>
magic keyword is necessary.
It's normally in connection with 'text item delimiters'.
In this context, 'AppleScript' is a global variable which allows you to get
properties of AppleScript itself rather than those of the current target.
Some folks apply it consistently to tids - just to be on the safe side.
Others (including me) generally apply it only within tell blocks (when the
target is not the current script). A few substitute "my" for "AppleScript's"
(which is shorter and generally reliable - although there are a few rare
conditions which might impact on its use.)
Malcolm's suggestion was a good solution - although he obviously wasn't
aware that you intended to use it within an application tell block. As
you've now discovered, the tids 'owner' needs to be specified in such
circumstances - to avoid an error number -10006 (errOSACantAssign: indicates
that an object can't be set in a container).
If possible, it's generally better to try and keep the general AS stuff away
from a tell block altogether:
--===========================
set oldStr to "xx xx xx xx"
set newStr to oldStr's words as string
tell application "Tex-Edit Plus"'s window 1
replace looking for oldStr replacing with newStr
end tell
--===========================
>
Are there other TID outside AS ?
If you mean are there any applications which might also use the term 'text
item delimiters', I'm not specifically aware of any (although others may
know different). However, even if that were the case, applying the above
principles should still produce a script that compiles and runs as intended.
>
Thanks again.
No problem. :-)
--
Kai
_______________________________________________
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.