Automator Newbie question - Can this be done?

Discussion in 'Mac Apps and Mac App Store' started by thomasp, Aug 27, 2005.

  1. thomasp macrumors 6502a

    Joined:
    Sep 18, 2004
    Location:
    UK
    #1
    Hi,

    I have never used Automator before, and would like to know if I can use it for the following:

    I have about 200 .html files, edited in TextEdit as a text file (not RTF) and saved with the .html extension. About 80% of these files have a short line in them (identical in all files) that needs replacing with a different line (will be the same for all files).

    Can Automator check all 200 files for this line, replace it with the new line and then resave the text files with exactly the same filename and extension?

    If so, how can I do this?


    Thanks for the help :)
     
  2. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #2
    No need for Automator. Use the (very) advanced, but still easy to use, Find feature in TextWrangler (just check the multi-file search).
     
  3. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #3
    Actually, I would think it should be possible in Automator too, but I don't see a really easy and non-messy way to do it, because I don't see an action for find/replace in TextEdit, and come to think of it, this isn't a feature in TextEdit. :eek: I think that will make the Automator approach very difficult. :(
     
  4. thomasp thread starter macrumors 6502a

    Joined:
    Sep 18, 2004
    Location:
    UK
    #4
    There is a find/replace in TextEdit - Edit Menu --> Find --> Find... --> Click "Replace"


    I'll check out that TextWrangler - thanks for the link :)
     
  5. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #5
    I think he meant Automator actions, where find/replace, for some insane reason, is not among the actions Automator "inherit" from TextEdit.

    But, if you download and start using TextWrangler, you never have to use TextEdit again (except for opening rtf/doc files, but for text files you now have a better application... much better... ;))
     
  6. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #6
    Ahhh, okay, I didn't click on it just then and hadn't remembered using it... I don't edit much in TextEdit -- I usually use Word for complex documents. :eek: Although there still doesn't seem to be an easy way to access this feature in Automator....

    Anyway, hope that TextWrangler works out for you. :)
     

Share This Page