Re: TIDs and other questions
Re: TIDs and other questions
- Subject: Re: TIDs and other questions
- From: Deivy Petrescu <email@hidden>
- Date: Sat, 26 Apr 2003 22:48:14 -0400
On Friday, April 25, 2003, at 01:07 PM, Deivy Petrescu wrote:
>
Since there has been some discussions on TIDs, I have a question and a
>
comment in this topic.
>
>
Question:
>
One problem I have been having (for a while with X) is the following,
>
when I type :
>
AppleScript's text item delimiters
>
>
or simply
>
>
text item delimiters.
>
>
AS does not understand the "delimiters" as part of the App keywords. I
>
have to remove the final "s", recompile and them put the final "s"
>
again and recompile. Sometimes more than once to get it to properly
>
understand the whole expression.
>
>
Does anybody have or heard of this problem?
Answer: apparently this is happening only here!
>
>
Comment:
>
About "AppleScript's text item delimiters" or "text item delimiters",
>
a while ago, I noticed that using Smile or SE would yield different
>
results when using "text item delimiters". Not so with "AppleScript's
>
text item delimiters" . I believe I reported this to the list, and I
>
should have the report securely saved somewhere that I can not
>
recollect.
>
I understand JD's point but there are circumstances where
"AppleScript's" will make my sleep a bit better.
Bill is right, the same script compiles ( but does not run) in Mail,
for instance:
<script>
tell app "Mail"
set text item delimiters to "x"
end tell
</script>
will compile but will error when run.
Steve's example is the reason that an "AppleScript's" will give me
the peace of mind.
A "more-to-the-point-but-less-clever" example is as follows:
<script>
property text item delimiters : {""}
set {text item delimiters, AppleScript's text item delimiters, my text
item delimiters} to {"a", "b", "c"}
{text item delimiters, AppleScript's text item delimiters, my text item
delimiters}
--->{"c", "b", "c"}
</script>
So "my" might be redundant as well depending on the situation. Since
I've noticed some different behaviours depending on the situation,
There will be some instances where I would strongly recommend
"AppleScript's text item delimiters".
On Friday, April 25, 2003, at 06:37 PM, John Delacour wrote:
>
Won't make a scrap of difference. Scriptable Text Editor has had
>
'text item delimiters' for years and MY text item delimiters are not
>
ITs. MY text item delimiters belong to the script. If you change
>
"Applescript's" (== my) text item delimiters to "@@@" within an
>
applet, the text item delimiters are not suddenly going to change all
>
over the universe and no effect will be had on Script Editor, Smile,
>
Script Debugger or any other script.
>
>
Please yourselves.
Absolutely true.
>
>
>
Question:
>
Has anybody been able to "read", via AS, the contents of a clipping
>
file (the file that the Finder creates when text is dragged and
>
dropped on the desktop) ?
>
The only thing I get is eof error. This is it or is it possible to do
>
it?
>
JD's and Emmanuel answers using Satimage OSAx works well indeed.
An example is as follows:
<script>
<WARNING>
This script uses Satimage OSAx
</WARNING>
set f to ("" & (path to desktop) & "A miserably long, very long name
for this clipping.textClipping")
set theText to (load resource 256 type "TEXT" from alias f)
</script>
The long name is just in contraposition the other "vanilla" script in
which, as JD pointed out, the name has to be one letter long.
<script>
<WARNING>
This script uses DeRez from the Developer CD.
</WARNING>
set k to ("" & (path to desktop) & "b.textClipping") --put the
appropriate path here, clipping has to have a one letter name
set k to POSIX path of k
set dt to "/Developer/Tools/DeRez -only 'TEXT' "
set text item delimiters to "/*"
set wtext to text items 2 thru -1 of (do shell script dt & k) as string
set myclipping to ""
repeat with kc from 1 to (count of text items in wtext)
set tikc to text item kc of wtext
set text item delimiters to ""
set myclipping to myclipping & (characters 2 thru ((offset of "*" in
tikc) - 2) of tikc) as string
set text item delimiters to "/*"
end repeat
set text item delimiters to ""
</script>
This script besides needing an adjustment in the name of the clipping,
it also loses all "returns" or line breaks ( this is not the case with
the previous one).
JD proposed the following script, which did not work on my machine:
<script>
<WARNING>
This script uses DeRez from the Developer CD.
</WARNING>
set fMac to "" & (path to "cusr") & "a.textclipping"
set f to POSIX path of fMac
set pl to "@lines = `/Developer/Tools/./Derez " & f & " -only
\"TEXT\"`;
for (@lines) {
/\\$\\\"/ and s~\\$\\\"(.+)\\\".+~$1~g
and s~\\s~~g or $_ = \"\" ;
print pack \"H*\", $_ ;}"
do shell script "perl -e '" & pl & "'"
-->"Can't make some data into the expected type." highlighting the
last line.
</script>
>
>
Question:
>
Is KeyChain Access scriptable in reality or just nominally?
>
It does not seem to follow the most elementary forms of its
>
dictionary, eg unlock keychain "a" with password 'b" gives me the
>
error "a keyword can not go after a keyword" or something like that...
This was my fault. I used Access instead of Scripting.
Thanks to all that replied.
Regards
Deivy Petrescu
http://www.dicas.com/
_______________________________________________
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.