linermental.blogg.se

Combine pdfs preview mac
Combine pdfs preview mac













Your script shows “Can’t make file into type alias”Ĭhoose folder with prompt "Please choose a folder."ĭo shell script "find -f '/Work/15-7069-2/' \\( -path '*/aaa/bbb*/*' -depth 3 -type f -name '*.pdf' \\) | Set AppleScript's text item delimiters to astidĭo shell script "/System/Library/Automator/Combine\\ PDF\\ Pages.action/Contents/Resources/join.py " & "-o " & pdfPaths Set pdfPaths to (paragraphs of quoted form of pdfPaths) as text

combine pdfs preview mac

Set AppleScript's text item delimiters to "' '" Set astid to AppleScript's text item delimiters Make a single line of the output path and input paths, all individually quoted and separated by spaces. Set outputPath to paragraph 1 of pdfPaths Grab the output path for the return at the end. Set pdfPaths to (do shell script pathScript)

#Combine pdfs preview mac pdf#

# Derive the output path from the first pdf path and output it first. Sed -E '# Make the double slashes in the paths single. Set pathScript to "find -f " & quoted form of POSIX path of topFolder & " \\( -path '*/aaa/bbb*/*' -depth 3 -type f -name '*.pdf' \\) |

combine pdfs preview mac

Get the POSIX paths to all the PDFs in folder aaa/bbb./ of the chosen folder and derive an output path (name of top folder & ".pdf" in the bbb.

combine pdfs preview mac

Set topFolder to (choose folder with prompt "Please choose a folder.") There should ideally be a space between the output file and the pdf files in the ‘do shell script’ line:ĭo shell script "/System/Library/Automator/Combine\\ PDF\\ Pages.action/Contents/Resources/join.py " & "-o " & quoted form of POSIX path of outputfile & space & pdffiles Set outputfolder to (choose folder with prompt "please choose where to save the merged pdf.") Set inputfiles to (choose file of type "PDF" with prompt "please choose the files to merge." with multiple selections allowed without invisibles)

  • The “please choose” prompts could be incorporated into the ‘choose’ dialogs, which would mean less OK-ing for the user ” although the prompts themselves would then be quite small:.
  • Other comments about the script would be: Set outputfile to (outputfolder as text) & "aaa:bbb:" & XXXX & ".pdf" with this: tell application "System Events" to set XXXX to name of outputfolder display dialog "Type the name of the combined pdf: " default answer "" You haven’t answered Craig’s questions, but the immediate answer to your query would be to replace this section.

    combine pdfs preview mac

    Save the combined pdf in the folder (MacIntosh\XXXX\aaa\bbb) with the filename XXXX.pdf.On that folder there will be a default folder “bbb” (which contains pdfs) (MacIntosh\XXXX\aaa\bbb).On that chosen folder there will be a default folder “aaa” (MacIntosh\XXXX\aaa).Set pdffiles to pdffiles & " " & quoted form of POSIX path of pĭo shell script "/System/Library/Automator/Combine\\ PDF\\ Pages.action/Contents/Resources/join.py " & "-o " & quoted form of POSIX path of outputfile & pdffiles Set outputfile to (outputfolder as text) & thename & "(" & (count of inputfiles) & ").pdf" Set thename to text returned of the result Set inputfiles to choose file of type "PDF" with multiple selections allowed without invisiblesĭisplay dialog "please choose where to save the merged pdf." default button "OK"ĭisplay dialog "Type the name of the combined pdf: " default answer "" I got the below script to combine pdfs into single pdf, which works fine.ĭisplay dialog "please choose the files to merge." default button "OK"













    Combine pdfs preview mac