Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Re: Applescript...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 16 Topic 1609 of 1636
Post > Topic >>

Re: Applescript to work with text. I'm stuck.

by J. Stewart <cfnzrpu@[EMAIL PROTECTED] > May 4, 2008 at 06:50 AM

On 2008-05-04 05:41:44 -0400, Fuddled <fuddled@[EMAIL PROTECTED]
> said:

> Hi nice peoples
> 
> I'm working in BBEdit, preparing academic documents to be browser-read,
> and I'd like to reproduce a script I have written for FileMaker Pro,
> which places tags round either side of a selection.
> 
> e.g. if I want to markup a word/phrase for italics, in FileMaker I can
> easily write a script that copies
> 
> selection
> 
> and replaces it with
> 
> <i>selection</i>
> 
> Sole purpose: to do the job quicker than manually copy-pasting the
> front tag, then pasting the end tag, backing up 2 spaces and inserting
> the /. Time after time.
> 
> Nothing fancy. I thought it would be simple to reproduce this tool in
> Applescript for use in BBEdit, but I'm stuck!! I've gone googling for
> help, and now I'm even more confused than I was before. I got some of
> it to work, but not the whole trick.
> 
> Maybe I should buy a book, but the one I found in a library doesn't
> seem to provide help in this area. There doesn't seem to be any guide
> or whatever that suits my limited CODING expertise. Perhaps Applescript
> isn't designed for this sort of thing?
> 
> So I'm simply asking you guys who DO understand:
> 
> 1) can I do this? and how?
> 
> AND
> 
> 2) will a book like Applescript for Dummies cover this sort of thing?
> 
> All this has sure made me feel like a dummy, and I hope some kind
> person has the patience to help me out.
> 
> Thanks in (hopeful) anticipation.

Have you tried something like this?

--> Cut <--
tell application "BBEdit"
	set selection to "<i>" & (get selection) & "</i>"
end tell
--> Cut <--

This works fine in TextWrangler which is almost identical to BBEdit 
where scripting is concerned.
> 
-- 
Use ROT 13 on email address for replies to sender
 




 16 Posts in Topic:
Applescript to work with text. I'm stuck.
Fuddled <fuddled@[EMAI  2008-05-04 09:41:44 
Re: Applescript to work with text. I'm stuck.
J. Stewart <cfnzrpu@[E  2008-05-04 06:50:50 
Re: Applescript to work with text. I'm stuck.
Fuddled <fuddled@[EMAI  2008-05-05 02:28:24 
Private Message
   2008-05-04 20:23:37 
Re: Applescript to work with text. I'm stuck.
J. Stewart <cfnzrpu@[E  2008-05-04 07:22:58 
Private Message
   2008-05-04 07:52:28 
Re: Applescript to work with text. I'm stuck.
Fuddled <fuddled@[EMAI  2008-05-05 02:38:32 
Re: Applescript to work with text. I'm stuck.
Jolly Roger <jollyroge  2008-05-04 14:08:18 
Re: Applescript to work with text. I'm stuck.
Fuddled <fuddled@[EMAI  2008-05-05 02:44:26 
Re: Applescript to work with text. I'm stuck.
Jolly Roger <jollyroge  2008-05-04 22:13:39 
Re: Applescript to work with text. I'm stuck.
Fuddled <fuddled@[EMAI  2008-05-05 12:09:26 
Private Message
   2008-05-05 08:17:42 
Re: Applescript to work with text. I'm stuck.
Jolly Roger <jollyroge  2008-05-05 20:56:59 
Re: Applescript to work with text. I'm stuck.
Jerry Kindall <jerryki  2008-05-05 19:54:21 
Re: Applescript to work with text. I'm stuck.
Jolly Roger <jollyroge  2008-05-05 22:41:58 
Re: Applescript to work with text. I'm stuck.
Fuddled <fuddled@[EMAI  2008-05-07 06:45:58 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 10:17:46 CDT 2008.