Hi all.
I'm a very recent mac convert (in fact, been using a mac for less than two weeks now), and am having some trouble with Applescript. I'm trying to create a little script which will work with Tex-Edit+ (which I like very much) to append and prepend square brackets to my selection. (IOW, I'm trying to make writing for Everything2 easier).
Here's the script, so far:
--
-- This script makes the selected text into hardlinks for E2
--
tell application "Tex-Edit Plus"
if not (window 1 exists) then
beep
return
end if
if number of words in the selection is 0 then
display dialog �
"Select some text which you would like to hardlink." buttons {"OK"} �
default button "OK" with icon note
return
end if
set e2clip to "[" & selection & "]" as string
set the clipboard to e2clip
paste
end tell
It seems to me to be pretty simple. Take the selected text, dump it into a variable, add the square brackets, put the variable onto the clipboard and paste it into the document. However, whenever I try to run the script, I get either an error -39 (problem with end of file) or a 'Resource not found error'.
I know this might be a little far afield from the normal discussions here, but if someone could point me in the right direction, that would be wonderful.