Re: How to download multiple PDF files based on a date input
Re: How to download multiple PDF files based on a date input
- Subject: Re: How to download multiple PDF files based on a date input
- From: Ben Waldie <email@hidden>
- Date: Mon, 27 Apr 2009 13:59:54 -0400
Wassim,
On Apr 26, 2009, at 5:54 AM, Wassim Jabi wrote: I would like to use Automator to automatically download multiple PDF files that are published daily and stored according to the date of publication. The format for the URL is as follows: http://www.somesite.com/issue/YYYY/MM/DD/X.pdf where YYYY = Year (e.g. 2009) MM = 2-digit Month (e.g. 08) DD = 2-digit Day (e.g. 24) X = pagenumber (e.g. 1) Example: http://www.somesite.com/issue/2009/04/25/1.pdfIdeally, I would like Automator to ask me for a date (and fill in today's date as a default in the above format) and ask for how many pages to download. Then to loop through the number of pages and download the PDFs to pre-specified folder on my Mac. Any pointers on how to do this?
You can use workflow variables in Automator to get dates and format them a certain way. You can also perform basic looping using the "Loop" action. However, the overall workflow you've described is likely a bit too complex for Automator without utilizing something like AppleScript to help. My suggestion would be to write a script to build the URLs, and then use the "Run AppleScript" action to run the script and pass the URLs down to the "Download URLs" action.
For example, here's a start to a script...
set theYear to "2009" set theMonth to "04" set theDay to "25" set theNumberOfPages to 5 set theURLs to {} repeat with a from 1 to theNumberOfPages set end of theURLs to theBaseURL & "/" & theYear & "/" & theMonth & "/" & theDay & "/" & a & ".pdf" end repeat return theURLs
This would need to be modified to prompt you for the date, or you'd need to adjust it in the action each time you run the workflow.
Hope this helps.
-Ben Ben Waldie President Automated Workflows, LLC 610.935.0652 ============================================= AppleScript * Automator * Workflow Automation Products, Training, Custom Development Services =============================================
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden