re posting scripts
re posting scripts
- Subject: re posting scripts
- From: Peter Long <email@hidden>
- Date: Fri, 16 Feb 2001 10:42:34 -0800
It might have been Shane? who posted this on the indesign scripting
board at the adobe site in response to scripts displaying wierdly for
that forum. It seems to work for me. Is this what is needed, or a
variation of? The board seems down at present so can't be specific
Peter
<pre>
set x to the clipboard as string
set theFinds to {"&", tab, ">",
"<", ">=", "<=", " is not
equal to ", "\"", "¬",
"®", "©", "«",
"»", "&trade;"}
set theReps to {"&amp;", " ",
"&gt;", "&lt;", ">=",
"<=", " is not equal to ",
"&quot;", "&not;", "&reg;",
"&copy;", "&laquo;",
"&raquo;", "&trade;"}
set oldDelims to AppleScript's text item delimiters
repeat with i from 1 to count of theFinds
set AppleScript's text item delimiters to item i of theFinds
set x to text items of x
set AppleScript's text item delimiters to item i of theReps
set x to x as text
end repeat
set AppleScript's text item delimiters to oldDelims
set the clipboard to "<pre>" & return & x
& return & "</pre>"
</pre>
Brad's suggestion was to create a tool that would take an AppleScript and
convert it into a form that isn't corrupted by the list server. That script
could then be posted safely, and that tool (or a mirror one) could then be
used to decode it on the other side to be used.
Since the scripts are already mostly readable (the problem are the
macOS-specific characters not part of the standard ascii character set),
this wouldn't impact the readability of posted code significantly, either.
It could even be written in AppleScript. The translations wouldn't be that
hard, and it'd give us a good workaround for the problem quickly.
If the users of these lists agree with me and someone's willing to put the
tools together, I'll be more than happy to host them on the list site for
download, and update the documentation to describe them and how to use them
and support their use on the list in an official way. I don't have the
resources to write these tools myself right now (or I would), but it seems
to me they'd be quick, straightforward, and easy to use.
This seems to me a way to make this work for people NOW, until I have time
to find a permanent solution that doesn't involve a workaround. And I
promise I *will* continue to look at that, this won't cause me to downgrade
it's priority or drop it off my todo list.
What do people think? I'm willing if you are, but I don't want to shove this
down your throats if you don9t think it's workable.
Chuq
--
Peter Long (email@hidden)
Lost Moose Publishing
http://www.yukonweb.com/business/lost_moose/
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
K-L Services
http://www.yukonweb.com/business/lost_moose/books/k-l/k-l_frame.html
58 Kluane Crescent
Whitehorse, Yukon, Y1A 3G7, Canada
867-668-5076,
fax:867-668-6223
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||