Jump to content
Macro Express Forums

sgtaw

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by sgtaw

  1. I'll see if I can swing some time in the next day or two. But it's a busy time for me right now. You will see what I am suggesting is super simple and fast. It's probably the case where it's just functions you are not familiar with yet. But they are so simple Should only take me about 10 minutes.

     

    HI Cory,

     

    Thanks so much.

     

    I will look at it again. and try to figure it out.

     

    Blessings,

     

    Ed

  2. Hi All,

     

    I'm sorry is this is covered somethere already.

     

    I wrote a macro to select a random line from a text file. It works great (The code is really ugly but it works ;-)

     

    Now, my problem is: I can't figure out how to delete that random line from the text file.

     

    Can anyone help?

     

    Here is my macro

     

    <VARIABLE SET INTEGER Option="\x00" Destination="%N[1]%" Value="0"/>
    <TEXT FILE BEGIN PROCESS Filename="C:\\Users\\Edward Aw\\Desktop\\TEST\\NoName01.txt" Start_Record="1" Process_All="TRUE" Records="0" Variable="%T[1]%"/>
    <VARIABLE MODIFY INTEGER Option="\x07" Destination="%N[1]%"/>
    <TEXT FILE END PROCESS/>
    <VARIABLE SET INTEGER Option="\x05" Destination="%N[2]%" Minimum="0" Maximum="%N[1]%"/>
    <TEXT FILE BEGIN PROCESS Filename="C:\\Users\\Edward Aw\\Desktop\\TEST\\NoName01.txt" Start_Record="%N[2]%" Process_All="FALSE" Records="1" Variable="%T[2]%"/>
    <TEXT FILE END PROCESS/>
    <TEXT TYPE Action="0" Text="%T[2]%<ENTER>"/>
    

     

    I attached the macro below.

     

    Thanks!

     

    Ed

    random line and delete.mxe

  3. I don't know anything about imacros but in ME one can launch a macro from the command line much like any application can. For instance you can launch a Word document by including the name in the word.exe command as a parameter. You might look to see if imacros supports such a thing and try that using the Program Launch command in MEP.

     

    Hi Cory,

     

    I tried to launch via command line in Firefox, but it doesn't work or (more likely) I have no cllue how to do it!

     

    Thanks,

     

    Ed

  4. Hi All,

     

    I searched the forum, but didn't see anything. I'm sure it is here.

     

    I want to read from a text file that is a txt. The text file has multiple rows with 2 elements per row. For Instance...

     

     

    ----------------BEGIN------------------

    apple,fruit

    turnip,vegetable

    cat,animal

    ...

    ----------------END--------------------

     

    The following code is an adaptation from code that I found here on the forum (thanks to whoever did it).

     

    	Variable Set Integer %N[1]% to 0
    Text File Begin Process: c:\list.txt
      Variable Modify Integer %N[1]%: Increment
    Text File End Process
    Variable Set Integer %N[2]% to a random value between 0 and %N[1]%
    Text File Begin Process: c:\list.txt
    Text File End Process
    Text Type (Simulate Keystrokes): %T[2]%<TAB>

     

    The direct code is here

     

    <VARIABLE SET INTEGER Option="\x00" Destination="%N[1]%" Value="0"/>
    <TEXT FILE BEGIN PROCESS Filename="c:\\list.txt" Start_Record="1" Process_All="TRUE" Records="0" Variable="%T[1]%"/>
    <VARIABLE MODIFY INTEGER Option="\x07" Destination="%N[1]%"/>
    <TEXT FILE END PROCESS/>
    <VARIABLE SET INTEGER Option="\x05" Destination="%N[2]%" Minimum="0" Maximum="%N[1]%"/>
    <TEXT FILE BEGIN PROCESS Filename="c:\\list.txt" Start_Record="%N[2]%" Process_All="FALSE" Records="1" Variable="%T[2]%"/>
    <TEXT FILE END PROCESS/>
    <TEXT TYPE Action="0" Text="%T[2]%<TAB>"/>

     

    This code first counts the number of lines in the TXT file.

     

    Then is randomly selects one of the lines to put into %T[2]%

     

    It works perfectly.

     

    However, I need to be able to parse that line into the two elements.

     

    So.

     

    %T[2]% = first element (before the comma)

    %T[3]% = second element (after the comma)

     

    I hope that explanation makes sense.

     

    Any chance this can be done?

     

    Thanks in advance for the help,

     

    Ed

  5. Hi All,

     

    I am trying to create a macro that will open different URLS (separate windows) from the urls in a txt file.

     

    I'm thinking that a loop could be used to read each line of the txt file and then a now firefox window is opened. Is this right?

     

    However, I am clueless as to how to create that loop that reads down a txt file. I have never done this in macro express.

     

    Thanks,

     

    Ed

×
×
  • Create New...