MACSCRPT Archives

August 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bill Briggs <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 2 Aug 2007 15:00:48 -0300
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
Personally, I wouldn't bother using AppleScript to do this. The find/replace in FrameMaker is rather powerful. I'd do it like this. First replace one instance of EUR with the deisred variable and then highlight the variable you just inserted and copy it to the clipboard. Then do a find on "EUR" (check the "considering case" box) and a "replace by pasting". That will fix it. This script looks to me like it's going to add more work than it's worth.

When you do the "replace by pasting", you have the chance to get them all done in one shot, or you could do change and find if you think there's a chance that it's going to screw up and replace something you don't want replaced.

Global changes in FrameMaker are very powerful, as is the Find/Change feature. I have done a lot of FrameMaker scripts in the past, but this doesn't seem to me to be necessary for what you want to do. Or did I miss something in the description?

 - web

At 7:40 PM +0200 8/2/07, Ludwig Geier wrote:
>Hello,
>I'll tried to replace a selected text in FrameMaker by a FrameMaker variable.
>
>Par example:
>String "Purchase Price List in EUR"
>The "EUR" should be substituted to the FrameMaker variable "currency"
>
>
>Code fragment:
>
>tell application "FrameMaker 7.0"
>
>...
>
>	set myText to (get text of selection)
>	set allVar to get properties of every variable format of document 1
>	
>	...
>
>	set myFlag to false
>	repeat with j from 1 to (count items in allVar)
>		
>		if myText is equal to (get format definition of (item j of allVar)) then
>			set myFlag to true
>			set myVarName to get (name of (item j of allVar))
>			exit repeat
>		end if
>
>	end repeat
>
>	...
>
>	if myFlag is true then
>-->	set ....  ((intention: replace selected text with the variable itself not the contents of the variable))
>
>Any idea, how the "set" command looks like?
>
>
>All ideas are welcome; thanks in advance!
>
>
>Ludwig

ATOM RSS1 RSS2