Combine Word Documents through Script


hello,

maybe can me accomplish this. here's trying do:
  1. for parent folder "untitled folder" on desktop, there many sub-folders inside. each sub-folder has 1-2 .docx files
  2. ultimate goal combine documents single pdf (ordering not matter)
  3. for each document, insert page break before inserting next document otherwise not readable easily
  4. for each document, @ top of insert, insert filename of document know next few pages on until next filename shows up

here's have far:
automator:
specified finder items
folder contents (repeat each subfolder found checked)
combine word documents
save word documents pdf

works; however, unable filename of each document before insert , unable page break.

apple script:
found code online , tried manipulating it, had absolutely no luck. change made add .docx it. same problems above when runs.

can assist or point me in right direction?

here's code:
code:
on open thefiles         tell application "microsoft word" set combodoc make new document         repeat 1 (count thefiles)         set thefile item of thefiles         set filepath thefile unicode text         tell application "finder"             set {creatype, filetype} {creator type, file type} of thefile             set ext name extension of thefile             set filename name of thefile         end tell         if (creatype "mswd" , {filetype} in {"bina", "w8bn", "s8bn", "w6bn", "s6bn", "rtf "}) or ext = "docx"             tell application "microsoft word"                 set comborange text object of combodoc                 set collapsedrange collapse range comborange direction collapse end                 insert file file name filepath @ collapsedrange             end tell         end if     end repeat     tell application "microsoft word" activate end open
 

there insert break command in microsoft word dictionary.

 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

OS X El Capitan on Unsupported Macs

[SOLVED] SFOTT usb key not bootable Mavericks

Fernando Torres: One of the all-time greats?