1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Imacros?

Discussion in 'General Programming Chat' started by fitnessdude1234, Sep 14, 2010.

Tags:
  1. fitnessdude1234

    fitnessdude1234 Newbie

    Joined:
    Jun 28, 2010
    Messages:
    16
    Likes Received:
    0
    Hi i don't know if this is the right section, mods please move it's in wrong.

    I want to know if its possible to use imacro to take a text file from a folder in my pc and run it through google translate and then save it in another folder.
    And then move on to the next file?

    Thanks in advance.
     
  2. matt1972

    matt1972 Regular Member

    Joined:
    Nov 19, 2009
    Messages:
    499
    Likes Received:
    206
    Occupation:
    To make money
    Location:
    192.168.0.1
    Yes. You will need to have your data in a external .csv file. I do this all the time with Imacros. Not sure how much you know about Imacros or if you have the Pro version or not, but you'll need your text file content one per line in a .csv file then you can run loop in Imacros and have it translated at G.
     
    • Thanks Thanks x 1
  3. heavyweight

    heavyweight Junior Member Premium Member

    Joined:
    Aug 10, 2009
    Messages:
    131
    Likes Received:
    65
    Yes you can do this. But IMacros has some limitations, if you hit on one of them you'll need to integrate it with another language.
     
  4. fitnessdude1234

    fitnessdude1234 Newbie

    Joined:
    Jun 28, 2010
    Messages:
    16
    Likes Received:
    0
    I don't have much experience with imacros but every one has to start somewhere.
    Thanks for the fast help.
     
  5. paincake

    paincake Power Member

    Joined:
    Aug 18, 2010
    Messages:
    716
    Likes Received:
    3,099
    Home Page:
    Put different texts in different rows of a first column in a csv file, save it in my documents\imacros\data sources folder.

    First, you need this at the beginning:
    Code:
    SET !DATASOURCE yourfile.csv
    SET !DATASOURCE_LINE {{!LOOP}}
    
    Then, you use COL1 variable in the actual form.
    Code:
    CONTENT={{!COL1}}
    After the text is translated, you can save it (you just need to know which html element to extract.
    You use this function:
    Code:
    ADD !EXTRACT
    Code:
    SAVEAS TYPE=EXTRACT FOLDER=C:\macros\ FILE=newarticles.csv
    (make sure you create that folder before running this macro)