Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Help with applescript and Tex-Edit+

Help with applescript and Tex-Edit+
Thread Tools
pimephalis
Dedicated MacNNer
Join Date: Nov 2002
Location: Rouge River
Status: Offline
Reply With Quote
Nov 27, 2002, 02:15 PM
 
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.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:54 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,