How to merge lecture notes from the web into a single PDF file

applescriptautomator

I have some lecture notes which are located at:

www.mywebsite.com/Lecture1.pdf

www.mywebsite.com/Lecture2.pdf

etc

In Automator I currently have done the following:

  1. Get specified URLs
  2. Download URLs
  3. Combine PDF pages
  4. Open Finder Items

This works, however, I have to manually type in all the URLs in step 1. Is there a simple way to automate all of this (maybe using AppleScript?)? I want something like

$list = 0
for $i = 1; $i <= 25; $i++
add "www.mywebsite.com/Lecture" + (toString)$i + ".pdf" to $list
end for
return $list

Edit: I managed to write this code:

on run {input, parameters}
    set i to 1
    set myList to {}
    repeat while i is not 26
        set ur to "http://www.website.com/Lecture" & {i as text} & ".pdf"
        set myList to myList & ur
        set i to i + 1
    end repeat
    return myList
end run

But for some reason the lecture notes are not merged in the correct order. What I get is Lecture 1, Lecture 3, Lecture 2, Lecture 4 etc. I also removed Step 1 from above.

Edit2: It seems I had to put a sort between Step 2 and 3. Now it works!

Best Answer

Easiest Way:

Put all PDFs in one folder.

Select All and Open.

Make sure View -> Thumbnails is checked, so you can make sure everything is in correct order.

Click File -> Print.

In Print Window, click PDF -> Save as PDF.