Re: search and replace in tex-edit
Re: search and replace in tex-edit
- Subject: Re: search and replace in tex-edit
- From: Mr Tea <email@hidden>
- Date: Wed, 12 Feb 2003 16:58:48 +0000
This from fabrice - dated 12-02-03 12.08 pm:
>
could you tell me what's wrong with that script:
>
>
>
tell application "Tex-Edit Plus F"
>
activate
>
set color of text of window 1 to black
>
set motClef to "le"
>
set newCol to blue
>
set sFont to font of text of window 1
>
set sOnS to style of text of window 1
>
set sSz to size of text of window 1
>
set sCol to color of text of window 1
>
replace looking for motClef ,
>
replacing with motClef ,
>
looking for styles ,
>
{font:sFont, style:sOnS, size:sSz, color:sCol} ,
>
replacing with styles ,
>
{font:sFont, style:sOnS, size:sSz, color:newCol} ,
>
--with cases matching
>
>
end tell
Your 'replace' command is not directed at anything. Change that line to:
replace of text of window 1 looking for motClef
...and it should work. But why type 'text of window 1' all those times when
you can do this instead:
tell application "Tex-Edit Plus"
activate
tell text of window 1
set color to black
set motClef to "le"
set newCol to blue
set sFont to font
set sOnS to style
set sSz to size
set sCol to color
replace looking for motClef [option+return]
replacing with motClef [option+return]
looking for styles [option+return]
{font:sFont, style:sOnS, size:sSz, color:sCol} [option+return]
replacing with styles [option+return]
{font:sFont, style:sOnS, size:sSz, color:newCol} [option+return]
--with cases matching
end tell
end tell
Regards,
Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.