Re: Finding a location in a text file
Re: Finding a location in a text file
- Subject: Re: Finding a location in a text file
- From: kai <email@hidden>
- Date: Sat, 19 Nov 2005 17:01:30 +0000
On 19 Nov 2005, at 16:21, Michelle Steiner wrote:
On Nov 19, 2005, at 7:25 AM, kai wrote:
tell application "Tex-Edit Plus" to tell front document to if
search looking for "want" then delete (text 1 thru character
(character before selection's offset))
You can use "then" to mean "next action"? It's not reserved
strictly for "if-then" constructs?
On reflection, it may seem as though that's the case at first glance,
Michelle. However, even in this case, the "then" is actually part of
an "if-then" construct.
My apologies for any confusion caused by the rather lengthy line.
Here's what the code might look like in a more regular, step-by-step
construct:
--------------------------------
tell application "Tex-Edit Plus"
tell front document
search looking for "want"
if result is true then
set | selection offset | to offset of selection
set | last delete position | to | selection offset | - 1
delete (text 1 thru character | last delete position |)
end if
end tell
end tell
--------------------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden