Hello,
Maybe someone can help me accomplish this. Here's what I am trying to do:
Here's what I have so far:
Automator:
Get Specified Finder Items
Get Folder Contents (Repeat for each subfolder found is checked)
Combine Word Documents
Save Word Documents as PDF
This works; however, I am unable to get filename of each document before its insert and unable to get a page break.
Apple Script:
I found this code online and tried manipulating it, but had absolutely no luck. Only change I made was add .docx to it. Same problems as above when this runs.
Can someone assist or point me in the right direction?
Here's the code:
Maybe someone can help me accomplish this. Here's what I am trying to do:
- For parent folder "Untitled Folder" on Desktop, there are many sub-folders inside. Each sub-folder has 1-2 .docx files
- Ultimate goal is to combine all the documents into a single PDF (ordering does not matter)
- For each document, insert a page break before inserting the next document otherwise it is not readable easily
- For each document, at the top of its insert, insert the filename of the document so I know what the next few pages are on until the next filename shows up
Here's what I have so far:
Automator:
Get Specified Finder Items
Get Folder Contents (Repeat for each subfolder found is checked)
Combine Word Documents
Save Word Documents as PDF
This works; however, I am unable to get filename of each document before its insert and unable to get a page break.
Apple Script:
I found this code online and tried manipulating it, but had absolutely no luck. Only change I made was add .docx to it. Same problems as above when this runs.
Can someone assist or point me in the right direction?
Here's the code:
Code:
on open theFiles
tell application "Microsoft Word" to set comboDoc to make new document
repeat with i from 1 to (count theFiles)
set theFile to item i of theFiles
set filePath to theFile as Unicode text
tell application "Finder"
set {creaType, fileType} to {creator type, file type} of theFile
set ext to name extension of theFile
set fileName to name of theFile
end tell
if (creaType is "MSWD" and {fileType} is in {"BINA", "W8BN", "s8BN", "W6BN", "s6BN", "RTF "}) or ext = "docx" then
tell application "Microsoft Word"
set comboRange to text object of comboDoc
set collapsedRange to collapse range comboRange direction collapse end
insert file file name filePath at collapsedRange
end tell
end if
end repeat
tell application "Microsoft Word" to activate
end open