[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

Re: FrameScript--applying character tag to range of text



Hi Jeff,

First of all, I would suggest that you subscribe to the framescript-users
group at http://groups.yahoo.com/group/framescript-users.

Here is a script that will get you started. This will only work with
FrameScript 2 and FrameMaker 6.

// Set variables for old name and new name.
Set OldName = 'Emphasis';
Set NewName = 'Italic'
// Make sure the NewName character format exists.
Get Object Type(CharFmt) Name(NewName)
  NewVar(vCharFmt);
If vCharFmt = 0
  MsgBox NewName + ' does not exist in this document.    ';
  LeaveSub; // Exit the script.
EndIf
// Find the OldName character format.
Find FromTextLoc(MainFlowInDoc) CharTag(OldName)
  ReturnRange(vRange) ReturnStatus(vStatus) NoWrap;
Loop While(vStatus = 1) // No quotes around the one.
  // Apply the new character format.
  Apply TextProperties TextRange(vRange)
    Properties(vCharFmt.Properties);
  // Find the next occurrence.
  Find FromTextLoc(vRange.End) CharTag(OldName)
    ReturnRange(vRange) ReturnStatus(vStatus) NoWrap;
EndLoop

Rick Quatro
Carmen Publishing
716 659-8267
rick@frameexpert.com
http://www.frameexpert.com

> Hello,
>
> I'm a FrameScript newbie, and I'm trying to figure out how to apply a
> character tag to a range of text. Can anyone help with this? Here's what
> I've got so far:
>
> Find FromTextLoc CharTag(OldName) ReturnRange(vRange)
ReturnStatus(vStatus);
> If vStatus = '1'
>     // change the CharTag for the text in vRange to NewName
> EndIf
>
> I've looked at the FrameScript docs, Rick Quatro's tutorials, and various
> sample scripts, but to no avail.
>
> Thanks for your help.
>
> - Jeff
>
>
> Jeff Williams
> Technical Writer
> CyberSource Corporation
> 1295 Charleston Road
> Mountain View, CA 94043
> Ph: 650.965.6588
> Fax: 650.625.9151
>
>
> -------------------------------------------------------------------
>          2001 FrameUsers Workshop coming to
>               Durham, NC, October 17-19, 2001
>           http://www.FrameUsers.com/workshop/
> -------------------------------------------------------------------
> Framers Archives:
> http://lists.frameusers.com/cgi-bin/lyris.pl?visit=framers
> -------------------------------------------------------------------
> === Personal List Subscription Information ====
> You are currently subscribed to framers as: rick@frameexpert.com
> To unsubscribe send a blank email to
leave-framers-70761C@lists.frameusers.com
>
> Send administrative questions to listadmin@FrameUsers.com.
> Visit the FrameUsers website: http://www.FrameUsers.com
> ======================================


** To unsubscribe, send a message to majordomo@omsys.com **
** with "unsubscribe framers" (no quotes) in the body.   **