As the title implies. I'm looking for a bash script that will iterate over html files in a folder and download the files to the same folder. I'm hoping someone in here has run into this before and hs something handy.

I had to do a massive dump of attachments via mass email and anything over 3mb gets turned into a .html file that links directly to the file in question, not the attachment record.

  • Hey David, this doesn't really have any specific connection to Salesforce so might be more on topic elsewhere in the Stack Overflow/StackExchange network. Maybe Super User?
    – David Reed
    Commented Dec 18, 2018 at 16:08
  • Well, it does in the sense that this is how Salesforce handles attachments over 3mb. I felt it was worth a shot since I'm sure a number of us have had to deal with it. I will be posing this question in superuser and unix/linux exhanges. If you feel it is completely irrelevant you can delete it.
    – weytani
    Commented Dec 18, 2018 at 16:10
  • 1
    My apologies if I misunderstood the context! For the benefit of folks like me that do not often work with attachment handling, could you add a little more context/detail? (Only moderators can delete questions, by the way; I'm happy to retract my close vote based on the Salesforce connection).
    – David Reed
    Commented Dec 18, 2018 at 16:11
  • No problem it was my fault for not being clearer.
    – weytani
    Commented Dec 18, 2018 at 16:16

1 Answer 1


So my solution is using Mac Automator and its Internet workflow actions to scrape these .html files for URLs and download the associated files. Works like a charm. Highly recommend looking into Mac Automator's functionality for scriptable actions like this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .