Re: Symbol typing
Re: Symbol typing
- Subject: Re: Symbol typing
- From: "Laine Lee" <email@hidden>
- Date: Mon, 16 Apr 2007 16:08:09 -0500
I didn't write this, Kai did, but I'm suggesting it (if you can
organize your scripts better than your Character Palette).
Maybe you could use this to put symbols on the clipboard, paste
into the description field, then drag into the script field.
Please tell me what part of the Applescript documentation I should
read to understand why I have to use "the clipboard" on the second
and fourth lines from the end instead of a variable.
-----------
on text_chunks from t by n
set c to count t
if c ² n then return {t}
set l to {}
tell n - 1 to repeat with i from n to c by n
set l's end to t's text (i - it) thru i
end repeat
if i < c then set l's end to t's text (i + 1) thru c
l
end text_chunks
set text_data to "7B5C727466315C6D61635C616E736963706731303030305C636F636F617274663832345C636F636F617375627274663432300A7B5C666F6E7474626C5C66305C6673776973735C666368617273657437372048656C7665746963613B7D0A7B5C636F6C6F7274626C3B5C7265643235355C677265656E3235355C626C75653235353B7D0A5C706172645C74783732305C7478313434305C7478323136305C7478323838305C7478333630305C7478343332305C7478353034305C7478353736305C7478363438305C7478373230305C7478373932305C7478383634305C716C5C716E61747572616C5C7061726469726E61747572616C0A0A5C66305C66733234205C636630205C2762325C2762337D"
set X_file to (path to temporary items as Unicode text) & "X.dat"
close the X_file
set X_ref to open for access X_file with write permission
set eof X_ref to 0
repeat with data_chunk in (text_chunks from text_data by 254)
write (run script "Çdata RTF " & data_chunk & "È") to X_ref
end repeat
close access X_ref
set the clipboard to (read file X_file as Çclass RTF È)
do shell script "rm " & (POSIX path of X_file)
get the clipboard as record
set the clipboard to result
-----------
And if you have to rebuild your launch services every time you
turn around because you have too many applications like I do,
maybe you'll appreciate this version of a Character Palette Toggler.
------
set app_ to "CharPaletteServer"
set proc_ to "/System/Library/Components/CharacterPalette.component/Contents/SharedSupport/CharPaletteServer.app/Contents/MacOS/CharPaletteServer"
try
do shell script "ps -auxwww | grep" & space & proc_ & space & "| grep -v grep"
tell application app_ to quit
on error
do shell script proc_ & space & "> /dev/null 2>&1 &"
end try
------
--
Laine Lee
_______________________________________________
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