Jump to content
Macro Express Forums

Text Manipulation In .doc Files?


kunkel321

Recommended Posts

Hi folks.

 

I am pretty new but have done some cool things with macEx so far.. I have been working with processing ASCII- and comma-delimited files. I have not been able to get this to work with standard MSWord ".doc" files. Is there something intrinsic to doc files that causes them to not play nicely with macEx? IT seems like Word docs would be among the most used in the macEx community. Most of my work templates are in word. I know very little about text types or programming, but shouldn't an ASCII character family behave the same in any document or document type?

 

The question: is it possible to process text in .doc files?

 

If not: the request: please add this.

 

Another request: Please consider adding the ability to process one-"word"-at-a-time or even better, one-CHARACTER-at-a-time. And to do so for simple evaluative purposes rather than allocating variables.

 

An example of what I'd like to do: Given this text:

"===Header one===

[body of text one]

 

===header two===

[body of text two]"

 

apply this script:

1. GO to My Documents/this text.doc and open it.

2. Start evaluating character by character.

3. when you're one character past "[" start highlighting text.

4. stop highlighting when you get to "]"

5. save the highlighted text to T1.

6. repeat with the next 'body of text' and the next variable.

 

Hense macEx just ignores any header or other directory-type information and only copies what I want it to. Please note that this particular example also assumes that I can assign MY OWN ASCII deliminators, in this case open bracket and closed bracket.

 

Thanks for considering this and thanks for a great product, it was well worth the $$ !!! -steveK

Link to comment
Share on other sites

Welp I think I figured out a way to 'trick' macEx into evaluating one character at a time (see above post). It involved

Text Type: Shift right arrow (to select) then Ctrl-C (to copy)

then set to T1 and compare against "[" or "]" and REPEAT. My thought was to send the variable to two different places. One place would keep comparing each character with [ or ] and the other would APPEND to a third variable. THis thrid variable would collect the string of chars. When the mac got to the "]" it would trigger a BREAK REPEAT so that the appending part would stop. THe collected STRING could then be sent back to the clipboard and used.

 

I tried different parts of this but gave up. It seems that getting stuff in and out of the clipboard takes time. My mac could only evaluate and collect about 4 chars per second, which is way too slow :-( Does anyone else have ideas of how to automate this? ALso note: I didn't try it in WOrd, only in a txt file.... -steveK

Link to comment
Share on other sites

Welp, still no replies other than me... In case anyone is interested though... here is the work around for the above problem. It does work in MSWord.

(put on separate lines for readability.)

<IVAR2:01:01:0>

<REP3:08:000007:000001:0001:0:01:[endall]>

<TEXTTYPE:<SHIFT><END>>

<CLIPC>

<TVAR2:01:03:>

<IFVAR2:1:01:7:[start]>

<IVAR2:01:01:1>

<ENDIF>

<IFVAR2:1:01:7:[end]>

<IVAR2:01:01:0>

<ENDIF>

<IFVAR2:2:01:1:1>

<TMVAR2:08:02:01:000:000:>

<ENDIF>

<TEXTTYPE:<HOME><ARROWDOWN>>

<ENDREP>

<TEXTTYPE:<END><ENTER>Variable T1 holds "%T1%".<ENTER>Variable T2 holds "%T2%"!<ENTER>Variable N1 holds the value "%N1%".>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...