Note that in InDesign......
Announcement
Collapse
No announcement yet.
Another VB Script to PowerBasic Problem
Collapse
X
-
-
Originally posted by Robert Wallace View Post(One definition on the Net (not Adobe) says that "FindText" returns an "Array of Text")
http://jongware.mit.edu/idcs6js/pc_Text.html
Leave a comment:
-
Originally posted by Michael Mattias View PostE.G.
PB's 'TALLY' function will give you that.
Leave a comment:
-
E.G.
Code:MsgBox ("Found " & CStr(myFoundItems.Count) & " instances of the search string.")
Leave a comment:
-
Just in general..
Don't always assume the best way to get the job done is to mindlessly port the VB script to PB. Maybe there is a better way to accomplish .. um, whatever it is this code is trying to accomplish.
MCM
Leave a comment:
-
Using VARIANTVT function I found out that "list" contained IDispatch (9).
I re-wrote the code as follows:
Code:LOCAL vtemp AS VARIANT LOCAL mytexts AS DISPATCH LOCAL mytext AS DISPATCH ..... ..... OBJECT CALL myDocument.FindText TO mytexts OBJECT GET mytexts.count TO vtemp j = VARIANT#(vtemp) FOR k = 1 TO j OBJECT GET mytexts.item(k) TO mytext OBJECT GET mytext.contents TO vtemp MSGBOX "Found word" & STR$(k) & ": " & VARIANT$(vtemp) NEXT k
Leave a comment:
-
Another VB Script to PowerBasic Problem
I have spent over a week trying to solve two lines of code!
VBScript snippet:
Code:Set myFoundItems = myInDesign.Documents.Item(1).FindText MsgBox ("Found " & CStr(myFoundItems.Count) & " instances of the search string.")
Code:MEMBER CALL FindText <1181639764> (OPTIONAL IN prm_ReverseOrder AS VARIANT<0>) AS InDesignObjects ' <dispinterface>
Code:LOCAL list AS VARIANT DIM listarray(1 TO 100) AS VARIANT ..... .... OBJECT CALL myDocument.FindText TO list
Code:OBJECT CALL myDocument.FindText TO listarray()
(One definition on the Net (not Adobe) says that "FindText" returns an "Array of Text")
Tags: None
Leave a comment: