Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

framescript-users · FrameScript Users

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 901
  • Category: Software
  • Founded: Aug 20, 1999
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 7812 - 7841 of 10492   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#7812 From: Brad Anderson <brad@...>
Date: Tue Oct 2, 2007 6:40 pm
Subject: Book Error
brad@...
Send Email Send Email
 
I'm having problems with a previously working script that adds files
to the end of a book.  This is the line of code that is causing the
error:

// Put file at end of book
Set vCurrentBookComp.PrevComponentInBook = 0;


Has anyone else seen this problem?

Thanks,

Brad

#7813 From: "Rick Quatro" <frameexpert@...>
Date: Tue Oct 2, 2007 9:11 pm
Subject: Re: Book Error
frameexpert@...
Send Email Send Email
 
Hi Brad,

Actually, I just did this in a script. To move a component to the end of the
book, you use:

Set oBookComp.NextComponentInBook = 0;

I think if you only have a single component in the book, you will get an
error, so I do this:

If i > 1
   Set oBookComp.NextComponentInBook = 0;
EndIf

The i counter keeps track of the number of components added to the book, so
if it is greater than 1, there is more than one component in the book.

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

I'm having problems with a previously working script that adds files
to the end of a book. This is the line of code that is causing the
error:

// Put file at end of book
Set vCurrentBookComp.PrevComponentInBook = 0;

Has anyone else seen this problem?

Thanks,

Brad

#7814 From: Brad Anderson <brad@...>
Date: Wed Oct 3, 2007 3:45 am
Subject: Re: Book Error
brad@...
Send Email Send Email
 
Rick,

I've tried that, too!  I end up with an empty book file.  Here's the
relevant code:

// Add the TOC component to the book and set its name and type.
	 New BookComponent BookObject(vCurrentBook) NewVar(vCurrentBookComp);
	 If book_component_type <> 'FM'
		 Set vBookComponent = vBookName + book_component_type + '.fm';
	 Else
		 Set vBookComponent = document_name;
	 EndIf
	 Set vCurrentBookComp.Name = vBookComponent;

	 // Set default document to a regular, non-generatable frame file
	 Set vCurrentBookComp.BookComponentType = BkNotGeneratable;
	 If book_component_type = 'TOC'
		 Set vCurrentBookComp.BookComponentType = BkToc;
		 Set vCurrentBookComp.GenerateInclude = True;
	 EndIf
	 If book_component_type = 'IX' OR book_component_type = 'IX2' OR
book_component_type = 'IX3' OR book_component_type = 'IX4'
		 Set vCurrentBookComp.BookComponentType = BkIndexStan;
		 Set vCurrentBookComp.GenerateInclude = True;
	 EndIf
	 If book_component_type = 'LOM'
		 Set vCurrentBookComp.BookComponentType = BkListMarker;
		 Set vCurrentBookComp.GenerateInclude = True;
	 EndIf
// Put file at end of book
	 Set vCurrentBookComp.NextComponentInBook = 0;






On Oct 2, 2007, at 4:11 PM, Rick Quatro wrote:

> Hi Brad,
>
> Actually, I just did this in a script. To move a component to the
> end of the
> book, you use:
>
> Set oBookComp.NextComponentInBook = 0;
>
> I think if you only have a single component in the book, you will
> get an
> error, so I do this:
>
> If i > 1
>   Set oBookComp.NextComponentInBook = 0;
> EndIf
>
> The i counter keeps track of the number of components added to the
> book, so
> if it is greater than 1, there is more than one component in the book.
>
> Rick Quatro
> Carmen Publishing
> 585-659-8267
> www.frameexpert.com
>
> I'm having problems with a previously working script that adds files
> to the end of a book. This is the line of code that is causing the
> error:
>
> // Put file at end of book
> Set vCurrentBookComp.PrevComponentInBook = 0;
>
> Has anyone else seen this problem?
>
> Thanks,
>
> Brad
>
>
>
> ------------------------------------
>     To post a message, email: framescript-users@yahoogroups.com
>     To subscribe, email: framescript-users-subscribe@yahoogroups.com
>     To unsubscribe, email: framescript-users-
> unsubscribe@yahoogroups.com
>     To contact the list owner, email: framescript-users-
> owner@yahoogroups.com
>     To change your email address or delivery options, visit: http://
> groups.yahoo.com/group/framescript-users
>     To promote this group on your web site, visit: http://
> groups.yahoo.com/group/framescript-users/promote
>
> Yahoo! Groups Links
>
>
>

#7815 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 3, 2007 12:01 pm
Subject: Re: Book Error
frameexpert@...
Send Email Send Email
 
Hi Brad,

// Put file at end of book
Set vCurrentBookComp.NextComponentInBook = 0;

This code should only be used if there is at least one other component in
the book. If there is only one, it has the effect of deleting the lone
component. You can do this to make sure there are at least two components in
the book:

If vCurrentBookComp.NextComponentInBook
   // Put file at end of book
   Set vCurrentBookComp.NextComponentInBook = 0;
EndIf

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7816 From: Dan Vint <dvint@...>
Date: Fri Oct 5, 2007 6:28 pm
Subject: Rearranging files in a book
dvint1_99
Send Email Send Email
 
Below is the code that I'm running. I'm trying to move the first file in
the book to the end of the list of files, but nothing seems to change with
this code. I have a book with 4 entries in this order:
title.fm
edition.fm
relnotesTOC.fm
relnotes.fm

And I want

edition.fm
relnotesTOC.fm
relnotes.fm
title.fm


The following is the console output from the if count - 2 section of the
code. It appears that when I make the assignment of the object to the
PrevComponentInBook, that this is resetting all the componets to equal the
one I'm using. So both the previous and next values are getting copied
instead of just the one I want. Any idea what's wrong? I also saw the post
yesterday about a single file book and handling the insertion properly.
I'm assuming this isn't coming into play.

Console output ------------------

Processing file: D:\Tool-dev\Framescript\relnotes\title.fm
Count: 1
First file: D:\Tool-dev\Framescript\relnotes\title.fm
Next file: D:\Tool-dev\Framescript\relnotes\edition.fm
Processing file: D:\Tool-dev\Framescript\relnotes\edition.fm
Count: 2
Second file: D:\Tool-dev\Framescript\relnotes\edition.fm
New Second Prev file: D:\Tool-dev\Framescript\relnotes\title.fm
New Second Next file: D:\Tool-dev\Framescript\relnotes\relnotesTOC.fm
New First book file: D:\Tool-dev\Framescript\relnotes\edition.fm
AFTER Second file: D:\Tool-dev\Framescript\relnotes\edition.fm
New Second Prev file:
New Second Next file: D:\Tool-dev\Framescript\relnotes\title.fm
Next file: D:\Tool-dev\Framescript\relnotes\title.fm
Processing file: D:\Tool-dev\Framescript\relnotes\title.fm
Count: 3
Next file: D:\Tool-dev\Framescript\relnotes\relnotesTOC.fm
Processing file: D:\Tool-dev\Framescript\relnotes\relnotesTOC.fm
Count: 4
Next file: D:\Tool-dev\Framescript\relnotes\relnotes.fm
Processing file: D:\Tool-dev\Framescript\relnotes\relnotes.fm
Count: 5
Next file:
Outside New First book file: D:\Tool-dev\Framescript\relnotes\title.fm
New last NEXT file:
New last 2 NEXT file: D:\Tool-dev\Framescript\relnotes\edition.fm
New last previous file:

   Code: ====================


Open Book File('relnotes.book') NewVar(lv_objBook)
   AlertUserAboutFailure(False) FileIsInUse(OpenEditableCopy)
FileIsOldVersion(Ok)
   FontNotFoundInCatalog(Ok) FontNotFoundInDoc(Ok) LockCantBeReset(Ok)
      RefFileNotFound(AllowAllRefFilesUnFindable) LockCantBeReset(Cancel)
UseRecoverFile(No);

Set lv_objComponent = lv_objBook.FirstComponentInBook;

   Write Console ' ';

Set ComponentCounter = 0;
   Loop While(lv_objComponent)

   Set ComponentCounter = ComponentCounter + 1;
   Write Console 'Processing file: '+lv_objComponent.Name;
   Write Console 'Count: '+ComponentCounter;


   if (ComponentCounter = 1)
    Set firstobjComponent = lv_objComponent;
    Write Console 'First file: '+lv_objComponent.Name;
   Elseif (ComponentCounter = 2)
         Write Console 'Second file: '+lv_objComponent.Name;
         Write Console 'New Second Prev file:
'+lv_objComponent.PrevComponentInBook.Name;
         Write Console 'New Second Next file:
'+lv_objComponent.NextComponentInBook.Name;

         Set lv_objComponent.PrevComponentInBook =
firstobjComponent.PrevComponentInBook;

          Write Console 'New First book file:
'+lv_objBook.FirstComponentInBook.Name;

         Write Console 'AFTER Second file: '+lv_objComponent.Name;
         Write Console 'New Second Prev file:
'+lv_objComponent.PrevComponentInBook.Name;
         Write Console 'New Second Next file:
'+lv_objComponent.NextComponentInBook.Name;

   Else
     ; // do nothing, we need to get to the end of the book
   Endif

          Set lv_objComponent = lv_objComponent.NextComponentInBook;
          Write Console 'Next file: '+lv_objComponent.Name;
EndLoop

          Set firstobjComponent.NextComponentInBook =
lv_objComponent.NextComponentInBook;  // should be null
          Set firstobjComponent.PrevComponentInBook = lv_objComponent;

     Write Console 'Outside New First book file:
'+lv_objBook.FirstComponentInBook.Name;
     Write Console 'New last NEXT file:
'+lv_objComponent.NextComponentInBook.Name;
     Write Console 'New last 2 NEXT file:
'+firstobjComponent.NextComponentInBook.Name;
     Write Console 'New last previous file:
'+firstobjComponent.PrevComponentInBook.Name;

=========================




---------------------------------------------------------------------------
Danny Vint

Specializing in Panoramic Images of California and the West
http://www.dvint.com

Voice:510:522-4703
FAX: 801-749-3229

#7817 From: "Rick Quatro" <frameexpert@...>
Date: Fri Oct 5, 2007 6:46 pm
Subject: ANN: HTML to FrameMaker Case Study
frameexpert@...
Send Email Send Email
 
Hello Framers,

I have long used FrameScript and MSXML to import XML into unstructured
FrameMaker files. MSXML is great because it uses standard XML technologies
such as XPath and XSLT to access and manipulate XML files. FrameScript can
"drive" MSXML using its EActiveXObject object.

There have been several instances where I wanted to import HTML files into
FrameMaker, but it wasn't possible with MSXML because it requires
well-formed XML. In some cases, it wasn't feasible or practical to convert
the HTML to well-formed XML. During a recent project, I discovered a simple
workaround to the HTML problem. I used regular expressions to extract the
necessary section from the HTML document and convert it to a well-formed XML
document. Then I used my usual MSXML process to import the data into
FrameMaker.

I have outlined the process in a small case study. You can see the PDF here

http://www.frameexpert.com/demos/htmltoframe.pdf

If you have any need for HTML to FrameMaker conversions, please let me know.
We can explore if it is feasible using FrameScript and MSXML. If your data
is non-proprietary and you would like to participate in a more detailed case
study, please let me know. Thanks.

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7818 From: "Rick Quatro" <frameexpert@...>
Date: Fri Oct 5, 2007 6:49 pm
Subject: Re: Rearranging files in a book
frameexpert@...
Send Email Send Email
 
Hi Dan,
 
Try this. It works for me:
 
Set oBook = ActiveBook;
Set oBookComp = oBook.FirstComponentInBook;
Set oBookComp.NextComponentInBook = 0;
 

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7819 From: Dan Vint <dvint@...>
Date: Fri Oct 5, 2007 7:47 pm
Subject: Re: Rearranging files in a book
dvint1_99
Send Email Send Email
 
At 11:49 AM 10/5/2007, you wrote:
>Try this. It works for me:
>
>Set oBook = ActiveBook;
>Set oBookComp = oBook.FirstComponentInBook;
>Set oBookComp.NextComponentInBook = 0;

I don't follow this. To me this would make the first object in the
book now the only object. What am I missing?

I'm trying to move the first object to be the last.

..dan
---------------------------------------------------------------------------
Danny Vint

Specializing in Panoramic Images of California and the West
http://www.dvint.com

voice: 510-522-4703

When H.H. Bennett was asked why he preferred to be out
shooting landscapes rather than spending time in his portrait studio:

"It is easier to pose nature and less trouble to please."

http://www.portalwisconsin.org/bennett_feature.cfm

#7820 From: "Rick Quatro" <frameexpert@...>
Date: Fri Oct 5, 2007 8:06 pm
Subject: Re: Rearranging files in a book
frameexpert@...
Send Email Send Email
 
Did you try it? Open a book with more than one component in it, copy/paste
the code into the Script Window and press the Run button. It moves the first
component to the end of the book.

If there is only a single component in the book, the code will delete it.
That is why you should do a test first:

Set oBook = ActiveBook;
Set oBookComp = oBook.FirstComponentInBook;
If oBookComp.NextComponentInBook
   Set oBookComp.NextComponentInBook = 0;
EndIf

Don't try to over-think it. It works, so adapt it to your script and use it.

Rick

At 11:49 AM 10/5/2007, you wrote:
>Try this. It works for me:
>
>Set oBook = ActiveBook;
>Set oBookComp = oBook.FirstComponentInBook;
>Set oBookComp.NextComponentInBook = 0;

I don't follow this. To me this would make the first object in the
book now the only object. What am I missing?

I'm trying to move the first object to be the last.

..dan
----------------------------------------------------------
Danny Vint

#7821 From: "Sven Haarkoetter" <shade3d@...>
Date: Thu Oct 11, 2007 1:58 pm
Subject: MSXML2, eActiveXObject : how to determine version?
cum_tacent_c...
Send Email Send Email
 

Hi all,

this time I have a minor problem with the MSXML ActiveX object.
Please check this:

New EActiveXObject NewVar (oXmlDoc) ProgId ('Msxml2.DOMDocument.7.0'); // 6.0 is installed on my machine
if (!oXmlDoc) 
  write console 'error'; // never throws an error
  leavesub; 
endif
set oXmlDoc.async=false //error if version > 6

So - what can I do to find out which version of MSXML  is installed on the users' machines? If it is ".5.0" for example (which I don't want)?

Thanks for any ideas,

sven


#7822 From: "Rick Quatro" <frameexpert@...>
Date: Thu Oct 11, 2007 2:06 pm
Subject: Re: MSXML2, eActiveXObject : how to determine version?
frameexpert@...
Send Email Send Email
 
Hi Sven,
 
Test the ErrorCode value of the NewVar object. If the ErrorCode is 0 then it loaded successfully; if it is not equal to 0, it did not load.

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com
New EActiveXObject NewVar (oXmlDoc) ProgId ('Msxml2.DOMDocument.7.0'); // 6.0 is installed on my machine
if (oXmlDoc.ErrorCode <> 0)
  write console 'error'; // never throws an error
  leavesub;
endif
set oXmlDoc.async=false //error if version > 6

#7823 From: "Sven Haarkoetter" <shade3d@...>
Date: Fri Oct 12, 2007 8:55 am
Subject: Re: MSXML2, eActiveXObject : how to determine version?
cum_tacent_c...
Send Email Send Email
 
Hi Rick,
thank you - again :O)
It works perfect now.

Sven

--- In framescript-users@yahoogroups.com, "Rick Quatro"
<frameexpert@...> wrote:
>
> Hi Sven,
>
> Test the ErrorCode value of the NewVar object. If the ErrorCode is
0 then it loaded successfully; if it is not equal to 0, it did not
load.
>
> Rick Quatro
> Carmen Publishing
> 585-659-8267
> www.frameexpert.com
>
> New EActiveXObject NewVar (oXmlDoc) ProgId
('Msxml2.DOMDocument.7.0'); // 6.0 is installed on my machine
> if (oXmlDoc.ErrorCode <> 0)
>   write console 'error'; // never throws an error
>   leavesub;
> endif
> set oXmlDoc.async=false //error if version > 6
>

#7824 From: "thebarbs1848" <egapbrab@...>
Date: Fri Oct 12, 2007 1:10 pm
Subject: RunEslBatch - script not executing when FrameMaker is already running
thebarbs1848
Send Email Send Email
 
Hello,

I'm very new to FrameScript. My goal is to write FrameScripts that
will run in batch mode. It is my understanding that when using
RunEslBatch, if FrameMaker is already running, RunEslBatch will
execute the FrameScript; if FrameMaker is not running, RunEslBatch
will start FrameMaker and execute the script.

I wrote a FrameScript that opens and saves a FrameMaker book. I'm
running the script using RunEslBatch from a .bat file. It seems that
if FrameMaker is already up and running when I start the .bat, the
FrameScript does not execute. If I shutdown FrameMaker and let
RunEslBatch start FrameMaker, the script runs perfectly. Any ideas on
why the script is not executing when FrameMaker is already up and
runnning? FrameScript is installed on a machine that usually has
FrameMaker running because batch AutoMap jobs also run regularly. So
chances are that when the FrameScript starts, FrameMaker will already
be running.

Thanks in advance.
Barb

#7825 From: "Rick Quatro" <frameexpert@...>
Date: Fri Oct 12, 2007 3:57 pm
Subject: Re: RunEslBatch - script not executing when FrameMaker is already running
frameexpert@...
Send Email Send Email
 
Hi Barb,
 
Open the EslBatch.ini in your Windows folder and make sure the path points to the correct version of FrameMaker. For example, here is the contents of my EslBatch.ini:
 
[FM]
ExeFile=C:\Program Files\Adobe\FrameMaker7.2\FrameMaker.exe

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7826 From: Dan Vint <dvint@...>
Date: Fri Oct 12, 2007 4:17 pm
Subject: Re: RunEslBatch - script not executing when FrameMaker is already running
dvint1_99
Send Email Send Email
 
Are your sure FrameScript is not starting Frame? I wonder if AutoMap
might be shutting down the session of Frame that it might have started to use.

..dan

At 06:10 AM 10/12/2007, you wrote:
>Hello,
>
>I'm very new to FrameScript. My goal is to write FrameScripts that
>will run in batch mode. It is my understanding that when using
>RunEslBatch, if FrameMaker is already running, RunEslBatch will
>execute the FrameScript; if FrameMaker is not running, RunEslBatch
>will start FrameMaker and execute the script.
>
>I wrote a FrameScript that opens and saves a FrameMaker book. I'm
>running the script using RunEslBatch from a .bat file. It seems that
>if FrameMaker is already up and running when I start the .bat, the
>FrameScript does not execute. If I shutdown FrameMaker and let
>RunEslBatch start FrameMaker, the script runs perfectly. Any ideas on
>why the script is not executing when FrameMaker is already up and
>runnning? FrameScript is installed on a machine that usually has
>FrameMaker running because batch AutoMap jobs also run regularly. So
>chances are that when the FrameScript starts, FrameMaker will already
>be running.
>
>Thanks in advance.
>Barb
>
>
>
>------------------------------------
>     To post a message, email: framescript-users@yahoogroups.com
>     To subscribe, email: framescript-users-subscribe@yahoogroups.com
>     To unsubscribe, email: framescript-users-unsubscribe@yahoogroups.com
>     To contact the list owner, email:
> framescript-users-owner@yahoogroups.com
>     To change your email address or delivery options, visit:
> http://groups.yahoo.com/group/framescript-users
>     To promote this group on your web site, visit:
> http://groups.yahoo.com/group/framescript-users/promote
>
>Yahoo! Groups Links
>
>
>

---------------------------------------------------------------------------
Danny Vint

Specializing in Panoramic Images of California and the West
http://www.dvint.com

voice: 510-522-4703

When H.H. Bennett was asked why he preferred to be out
shooting landscapes rather than spending time in his portrait studio:

"It is easier to pose nature and less trouble to please."

http://www.portalwisconsin.org/bennett_feature.cfm

#7827 From: "thebarbs1848" <egapbrab@...>
Date: Mon Oct 15, 2007 12:48 pm
Subject: Re: RunEslBatch - script not executing when FrameMaker is already running
thebarbs1848
Send Email Send Email
 
--- In framescript-users@yahoogroups.com, "Rick Quatro"
<frameexpert@...> wrote:
>
> Hi Barb,
>
> Open the EslBatch.ini in your Windows folder and make sure the path
points to the correct version of FrameMaker. For example, here is the
contents of my EslBatch.ini:
>
> [FM]
> ExeFile=C:\Program Files\Adobe\FrameMaker7.2\FrameMaker.exe
>
> Rick Quatro
> Carmen Publishing
> 585-659-8267
> www.frameexpert.com
>

I think adding the FrameMaker path to the EslBatch.ini file solved my
problem. I kicked off the .bat script twice this morning while
FrameMaker was already running and the FrameScript did run
successfully. I had read about the path in the EslBatch.ini file, but
I figured since RunEslBatch was starting up FrameMaker when it wasn't
already running, it must know the path for FrameMaker. It appears to
be working now. Thanks Rick!

Barb

#7828 From: "M J Davidson" <editrix@...>
Date: Mon Oct 22, 2007 11:31 pm
Subject: OT: Martha Jane Kolman, 1956-2007
mouditrix
Send Email Send Email
 
I regret to inform the framescript-users group that Martha Kolman
(mouditrix) succumbed to cancer on 12 June 2007.

A memorial website has been created at http://nemasys.com/mjk.

Wolf Davidson, her husband

#7829 From: "stever_two" <sefouts@...>
Date: Tue Oct 23, 2007 8:53 pm
Subject: Parent of an Object
stever_two
Send Email Send Email
 
I am brand new to Framescript, and I have a specific element that is
always the child of a table cell. I want to loop through the document
and alter the custom ruling and shading on the cells that have this
element inside them.

I figure I have two options:
1) Find FromTextLoc Element('MyElement') and then grab the cell that
I'm in and change away. But Find grabs an ElementRange and I don't
know how to find the parent of a range...
2) Crawl all the tables, rows, and cells, then look inside each cell
for the element that I want and if I find it, alter the ruling and
shading. But I haven't been successful finding the element inside the
cell. Probably because I haven't hit on the right combination of
objects, children, and attributes.

The element always contains the same string, and I have successfully
located the string in the cell, but unfortunately that string
sometimes occurs in other table cells as well. If anyone has some
pointers that will help me with that last little bit, I would be most
grateful.

#7830 From: "Rick Quatro" <frameexpert@...>
Date: Tue Oct 23, 2007 9:16 pm
Subject: Re: Parent of an Object
frameexpert@...
Send Email Send Email
 
Hi,
 
Can you send me a sample table offlist? Thanks.

Rick Quatro
Carmen Publishing
585-659-8267

#7831 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 24, 2007 12:35 am
Subject: Re: Parent of an Object
frameexpert@...
Send Email Send Email
 
Hi Steve,
 
Here is one way you could find the parent cell after you locate the element.
 
Set oDoc = ActiveDoc;
Find FromTextLoc(oDoc.MainFlowInDoc) Element('RSVD')
  ReturnStatus(iStatus) ReturnRange(tRange) NoWrap;
Loop While(iStatus)
  Set oPgf = tRange.Begin.Object;
  If oPgf.InTextObj.ObjectName = 'Cell'
    Set oCell = oPgf.InTextObj;
    Display oCell;
  EndIf
  Find FromTextLoc(tRange.End) Element('RSVD')
    ReturnStatus(iStatus) ReturnRange(tRange) NoWrap;
EndLoop
If you locate a paragraph containing the 'RSVD' text, you can use this to test for the 'RSVD' element.
 
If oPgf.InTextObj.ObjectName = 'Cell'
  Set oCell = oPgf.InTextObj;
  Set oElement = oCell.Element;
  If oElement.FirstChildElement
    Set oElement = oElement.FirstChildElement;
    If oElement.ElementDef.Name = 'RSVD'
      Display oCell;
    EndIf
  EndIf
EndIf
 
Thanks for buying my book. I am sorry that there are no structured FrameMaker examples in it. Hope this helps.

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7832 From: "erik_willemse" <erik.willemse@...>
Date: Wed Oct 24, 2007 9:04 am
Subject: HypertextCommandText: anyone ever used it?
erik_willemse
Send Email Send Email
 
Hi all,

There is a HypertextCommandText property for the document object in
framescript. This property comes with a number of others such as
HypertextParsedCmdDestObjID and it seems to be a parser for hypertext
commands.

Now, as far as I understand it, I should be able to read the
MarkerText
property from a marker, feed this to the HypertextCommandText parser
and get results/information from the parser such as the object ID of
the destination (HypertextParsedCmdDestObjID).

Below is an example script that sets a hypertext command and all
related properties are written to the console. Note: testlink is an
existing destination in the active document.

-----------------------------------
Set vCurrentDoc = ActiveDoc;
Set vCurrentDoc.HypertextDoValidate = true;
Set vCurrentDoc.HypertextCommandText = 'gotolink testlink'
write console 'HypertextDoValidate: ' +
vCurrentDoc.HypertextDoValidate;
write console 'HypertextCommandText: ' +
vCurrentDoc.HypertextCommandText;
write console 'HypertextParseBadParam: ' +
vCurrentDoc.HypertextParseBadParam;
write console 'HypertextParsedArgs: ' +
vCurrentDoc.HypertextParsedArgs;
write console 'HypertextParsedClientName: ' +
vCurrentDoc.HypertextParsedClientName;
write console 'HypertextParsedCmdDes:  ' +
vCurrentDoc.HypertextParsedCmdDes;
write console 'HypertextParsedCmdCode: ' +
vCurrentDoc.HypertextParsedCmdCode;
write console 'HypertextParsedCmdDest: ' +
vCurrentDoc.HypertextParsedCmdDest;
write console 'HypertextParsedCmdDestObjID: ' +
vCurrentDoc.HypertextParsedCmdDestObjID;
write console 'HypertextParsedCmdDestObjType: ' +
vCurrentDoc.HypertextParsedCmdDestObjType;
write console 'HypertextParsedCmdMatrixColumns: ' +
vCurrentDoc.HypertextParsedCmdMatrixColumns;
write console 'HypertextParsedCmdMatrixRows: ' +
vCurrentDoc.HypertextParsedCmdMatrixRows;
write console 'HypertextParsedDIFileName: ' +
vCurrentDoc.HypertextParsedDIFileName;
write console 'HypertextParsedFlowName: ' +
vCurrentDoc.HypertextParsedFlowName;
write console 'HypertextParsedLinkName: ' +
vCurrentDoc.HypertextParsedLinkName;
write console 'HypertextParsedMessage: ' +
vCurrentDoc.HypertextParsedMessage;
write console 'HypertextParsedPageName: ' +
vCurrentDoc.HypertextParsedPageName;
write console 'HypertextParsedTitle: ' +
vCurrentDoc.HypertextParsedTitle;
write console 'HypertextParseErr: ' + vCurrentDoc.HypertextParseErr;
write console 'HypertextParseErrMsg: ' +
vCurrentDoc.HypertextParseErrMsg;
write console 'HypertextValidateErr: ' +
vCurrentDoc.HypertextValidateErr;
-----------------------------------


The result in the console is below:
-----------------------------------
HypertextDoValidate: 1
HypertextCommandText: gotolink testlink
HypertextParseBadParam: 0
HypertextParsedArgs: STRINGLIST Count(2)
gotolink
testlink

HypertextParsedClientName:
HypertextParsedCmdDes:
HypertextParsedCmdCode: 11
HypertextParsedCmdDest: 1
HypertextParsedCmdDestObjID: 0
HypertextParsedCmdDestObjType: 0
HypertextParsedCmdMatrixColumns: 0
HypertextParsedCmdMatrixRows: 0
HypertextParsedDIFileName:
HypertextParsedFlowName:
HypertextParsedLinkName: testlink
HypertextParsedMessage:
HypertextParsedPageName:
HypertextParsedTitle:
HypertextParseErr: 0
HypertextParseErrMsg:
HypertextValidateErr: 0
-----------------------------------

I would expect that HypertextParsedCmdDestObjID contains the object
ID of the pgf where my destination marker is. But that seems not to
be the case.

Has anyone used this before? Documentation seems to be poor by maybe
someone has managed to figure it out? Any example scripts somewhere
available?

All help is really appreciated.

Regards,

Erik

#7833 From: "Bodvar Bjorgvinsson" <bodvar@...>
Date: Wed Oct 24, 2007 10:54 am
Subject: How to return the language description (language name)?
bbjorgvinsson
Send Email Send Email
 
I am slowly getting through the FS Crash Course
I am trying to get a list that shows which Language property
description applies to each Language Property DataType (integer). I
have no problem showing the integers when I, but how do I display the
name?
I got as far as this:

// START SCRIPT:
Set vPgf = TextSelection.Begin.Object;
Set vLang = vPgf.Properties.Language;
Set vLang = LangGerman;
Display vLang;
// END SCRIPT.

This little script displays the integer 3 in a new document in FM 7.2.

I want to set up a loop that scrolls through the integer values of the
Language property of all languages available and list the numbers and
the names, but I do not know what command/option to use.

Not a highly usable scripting, but something I would like to get to
the bottom of. :-)

Thanks,

Bodvar Bjorgvinsson

#7834 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 24, 2007 11:46 am
Subject: Re: How to return the language description (language name)?
frameexpert@...
Send Email Send Email
 
Hi Bodvar,
 
Many properties in FrameScript (and the FDK) are represented as integers. To make these integers "more readable" they often have constants defined as "words". So LangGerman means German (or Deutsch) but is really the integer 3. The list of human readable names shown in the Language popup menu is not exposed to FrameScript, as far as I know. So, you have to make your own list. Here is one way to do it:
 
// Make a string list to hold the language names.
New StringList NewVar(sLanguages);
Add Member('None') To(sLanguages);
Add Member('US English') To(sLanguages);
Add Member('UK English') To(sLanguages);
Add Member('Deutsch') To(sLanguages);
Add Member('Schweizerdeutsch') To(sLanguages);
Add Member('Francais') To(sLanguages);
Add Member('Canadien Francais') To(sLanguages);
Add Member('Espanol') To(sLanguages);
Add Member('Catala') To(sLanguages);
Add Member('Italiano') To(sLanguages);
Add Member('Portugues') To(sLanguages);
Add Member('Portugues do Brasil') To(sLanguages);
Add Member('Dansk') To(sLanguages);
Add Member('Nederlands') To(sLanguages);
Add Member('Norsk') To(sLanguages);
Add Member('Nynorsk') To(sLanguages);
Add Member('Suomi') To(sLanguages);
Add Member('Svenska') To(sLanguages);
Add Member('Nihongo') To(sLanguages);
Add Member('Traditional Chinese') To(sLanguages);
Add Member('Simplified Chinese') To(sLanguages);
Add Member('Korean') To(sLanguages);
Add Member('Deutsch (neu)') To(sLanguages);
Add Member('Schweizerdeutsch (neu)') To(sLanguages);
Add Member('Nederlands (nieuw)') To(sLanguages);
 
Set oPgf = TextSelection.Begin.Object;
// Display the paragraph's current language.
Display sLanguages[oPgf.Language+1];
 
// Translate a language integer constant to a string.
Display sLanguages[LangGerman+1];
 

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7835 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 24, 2007 12:37 pm
Subject: Re: HypertextCommandText: anyone ever used it?
frameexpert@...
Send Email Send Email
 
Hi Erik,
 
I have only used these commands once or twice, mainly to process generated list Hypertext markers. Here is an example:
 
// Set a variable for the active document.
Set oDoc = ActiveDoc;
// Hypertext marker text from a TOC entry.
Set sMarkerText = 'openObjectId introduceConnect.fm:2 1024177';
// Run the Hypertext commands to parse the marker text.
Set oDoc.HypertextDoValidate = True;
Set oDoc.HypertextCommandText = sMarkerText;
Display oDoc.HypertextParsedDIFileName;
Set sFile = oDoc.HypertextParsedDIFileName;
Set sFile = eStr.ReplaceAll{sFile,'<v>',''};
Set sFile = eStr.ReplaceAll{sFile,'<c>',DIRSEP};
Display sFile;
Display oDoc.HypertextParsedCmdDestObjType;
Display oDoc.HypertextParsedCmdDestObjID;
In your case you are trying to find the destination marker's paragraph ID. But there is no way to derive this from the "gotolink testlink" marker text. All you are really doing is parsing the marker text into its two tokens, "gotolink" and "testlink"; no further checking is being done by the command.
 
In my example code, the HypertextParsedCmdDestObjID returns the ID because it is already in the marker text. So again, it is simply parsing the marker text and returning each token into the special Hypertext variables.
 
I should point out that even if you want to parse openObjectId or gotoObjectId markers, using this method on a lot of markers can be slow.

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7836 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 24, 2007 4:47 pm
Subject: OT: Web site design
frameexpert@...
Send Email Send Email
 
Hello Framers and Scripters,

I am looking for some right-brain help (or is that left-brain?). I need a
web site design for my real estate business, particularly the home page. I
would like to barter this for some FrameScript work. If you are interested,
please contact me offlist. Thank you very much.

Rick Quatro
New Horizons Properties
585-659-8267
585-219-8959 Fax
585-729-6746 Cell
rick@...

#7837 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 24, 2007 5:17 pm
Subject: Clarification: Re: Web site design
frameexpert@...
Send Email Send Email
 
Just a little clarification. I don't need help coding the website, but with
the design itself (color combinations, page layout, logo, etc.). I am
looking for something clean and professional. Thanks.

Rick

> Hello Framers and Scripters,
>
> I am looking for some right-brain help (or is that left-brain?). I need a
> web site design for my real estate business, particularly the home page. I
> would like to barter this for some FrameScript work. If you are
> interested, please contact me offlist. Thank you very much.
>
> Rick Quatro
> New Horizons Properties
> 585-659-8267
> 585-219-8959 Fax
> 585-729-6746 Cell
> rick@...

#7838 From: "erik_willemse" <erik.willemse@...>
Date: Wed Oct 24, 2007 5:49 pm
Subject: Re: HypertextCommandText: anyone ever used it?
erik_willemse
Send Email Send Email
 
Hi Rick,

Thanks for the reply. Sorry for the long elaboration below but I hope
it is somehow clear and maybe you can share your ideas about it.

The reason why I need this is because I have had to write my own page
numbering mechanism (see also Message #7533) such as 7.1-1, 7.1-2,
7.2-1, 7.2-2, 7.3-1, ... and so on. Basically, I needed this because
the page numbering should reset based on a heading 2 within a
document. Now this is working fine: I have a script to reset,
recalculate and redraw the page number on the page, and I also write
it in page.userstring.

In addition I have a script that generates a list of definitions
(based on a PgfFmt) and a corresponding reference based on hypertext
links to the page. This is done on book level. When I generate the
list, I place newlink markers and I know my generated page number but
I was looking for a way to reset/recalculate/renumber the list of
definitions (e.g. required if there are page shifts and renumbering).
Hence the reason why I was looking at the HypertextCommandText
command.

Now according to your information this idea is not working... but,
based on your explanation, I wonder the following: is the paragraph
ObjectID always the same in a document? Is it fixed, once the
paragraph is created? And when the document is opened again?
So, if I place the objectID also in the hypertextmarker, and parse
it, I should be able to retrieve the pgf.page.userstring?

What do you think?

Regards,

Erik


--- In framescript-users@yahoogroups.com, "Rick Quatro"
<frameexpert@...> wrote:
>
> Hi Erik,
>
> I have only used these commands once or twice, mainly to process
generated list Hypertext markers. Here is an example:
>
> // Set a variable for the active document.
> Set oDoc = ActiveDoc;
> // Hypertext marker text from a TOC entry.
> Set sMarkerText = 'openObjectId introduceConnect.fm:2 1024177';
> // Run the Hypertext commands to parse the marker text.
> Set oDoc.HypertextDoValidate = True;
> Set oDoc.HypertextCommandText = sMarkerText;
> Display oDoc.HypertextParsedDIFileName;
> Set sFile = oDoc.HypertextParsedDIFileName;
> Set sFile = eStr.ReplaceAll{sFile,'<v>',''};
> Set sFile = eStr.ReplaceAll{sFile,'<c>',DIRSEP};
> Display sFile;
> Display oDoc.HypertextParsedCmdDestObjType;
> Display oDoc.HypertextParsedCmdDestObjID;
>
> In your case you are trying to find the destination marker's
paragraph ID. But there is no way to derive this from the "gotolink
testlink" marker text. All you are really doing is parsing the marker
text into its two tokens, "gotolink" and "testlink"; no further
checking is being done by the command.
>
> In my example code, the HypertextParsedCmdDestObjID returns the ID
because it is already in the marker text. So again, it is simply
parsing the marker text and returning each token into the special
Hypertext variables.
>
> I should point out that even if you want to parse openObjectId or
gotoObjectId markers, using this method on a lot of markers can be
slow.
>
> Rick Quatro
> Carmen Publishing
> 585-659-8267
> www.frameexpert.com
>

#7839 From: "Rick Quatro" <frameexpert@...>
Date: Wed Oct 24, 2007 6:50 pm
Subject: Re: Re: HypertextCommandText: anyone ever used it?
frameexpert@...
Send Email Send Email
 
Hi Erik,
 
Once a paragraph is created, its ObjectID (Unique property) usually stays fixed. If you copy and paste the heading to another location, the ID could change, but this usually isn't an issue.
 
That said, however, parsing the Hypertext marker text is not going to allow you to retrieve the paragraph properties (including the UserString) without actually opening the target document and getting the paragraph object. You will still need code to open the document, find the paragraph, and return the needed information. Of course, being able to easily parse the marker with the HypertextDoValidate command will facilitate the process.
 
Once you open the target document, you can get the paragraph object by using its ObjectID in the following code (assumes that oDoc is the target document and iUnique is the paragraph's ObjectID):
 
Get Object Type(Pgf) Unique(iUnique) DocObject(oDoc)
  NewVar(oPgf);

Rick Quatro
Carmen Publishing
585-659-8267
www.frameexpert.com

#7840 From: "erik_willemse" <erik.willemse@...>
Date: Wed Oct 24, 2007 9:03 pm
Subject: Re: HypertextCommandText: anyone ever used it?
erik_willemse
Send Email Send Email
 
Rick,

I will be running the code to open the doc, find the pgf etc...
anyway as it is part of an update book process... so probably the
fixed objectID in the hypertextmarker will do the trick. I will give
it a try in the morning.

Thanks for the input and help.

Regards,

Erik

--- In framescript-users@yahoogroups.com, "Rick Quatro"
<frameexpert@...> wrote:
>
> Hi Erik,
>
> Once a paragraph is created, its ObjectID (Unique property) usually
stays fixed. If you copy and paste the heading to another location,
the ID could change, but this usually isn't an issue.
>
> That said, however, parsing the Hypertext marker text is not going
to allow you to retrieve the paragraph properties (including the
UserString) without actually opening the target document and getting
the paragraph object. You will still need code to open the document,
find the paragraph, and return the needed information. Of course,
being able to easily parse the marker with the HypertextDoValidate
command will facilitate the process.
>
> Once you open the target document, you can get the paragraph object
by using its ObjectID in the following code (assumes that oDoc is the
target document and iUnique is the paragraph's ObjectID):
>
> Get Object Type(Pgf) Unique(iUnique) DocObject(oDoc)
>   NewVar(oPgf);
>
> Rick Quatro
> Carmen Publishing
> 585-659-8267
> www.frameexpert.com
>

#7841 From: Dan Vint <dvint@...>
Date: Wed Oct 24, 2007 9:11 pm
Subject: Deleting a file from a book
dvint1_99
Send Email Send Email
 
This is a followup question to my needing to move a file to the end of
book. Turns out there were more requirements. I think if I get the answwer
to deleting the file my other question will be answered.

So I a book with this content:
     title.fm
     edition.fm
     fooTOC.fm
     preface.fm
     chap1.fm
     ...
     fooIX.fm (not always here)

Here are the new twists:
1) If edition or preface.fm files exist they need to be deleted
2) if fooIX.fm exists, then title.fm needs to appear before it, otherwise
     title.fm goes to the end of the book

So I'm trying to now move fooTOC.fm to replace edition.fm. I've used this
to move title.fm to the end of the book:
      Set lv_objComponent = lv_objBook.FirstComponentInBook;
      if lv_objComponent.NextComponentInBook
         Set lv_objComponent.NextComponentInBook = 0;
      endif

Then I start a loop on the book to process and remove edition and preface
files:

Set lv_objComponent = lv_objBook.FirstComponentInBook;
Loop While(lv_objComponent)

        New EFileInfo NewVar(einfo) FileName(lv_objComponent.Name);

              /* Remove the edition.fm and preface.fm files from the book */
        If (einfo.FileName = 'edition.fm' and
lv_objComponent.NextComponentInBook)
              New EFileInfo NewVar(einfoNext)
FileName(lv_objComponent.NextComponentInBook.Name);
              if (einfoNext.FileName = 'preface.fm')
                    ; /* need to do something different if next file is 
preface.fm */
              else  /* process the edition.fm file in normal mode */

                    set editionComponent = lv_objComponent;
                    set nextComponent = lv_objComponent.NextComponentInBook;
                    set nextComponent.PrevComponentInBook =
editionComponent.PrevComponentInBook;

              endif
        endif

        Set lv_objComponent = lv_objComponent.NextComponentInBook;
EndLoop

SO I thought this would disconnect the editionComponent from the book,
instead it just seems to move it under the TOC file in the book.

Any ideas on fixing this problem?

thanks
..dan

---------------------------------------------------------------------------
Danny Vint

Specializing in Panoramic Images of California and the West
http://www.dvint.com

Voice:510:522-4703
FAX: 801-749-3229

Messages 7812 - 7841 of 10492   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help