Jump to content
Macro Express Forums

Strathos

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by Strathos

  1. Hello again

     

    Forget about the sample I posted before, its too messy.

     

     

    If the Folder that Contains the Subfolders is NOT inside the folder that contains the Files, this macro should work. Just run it, no need to change anything.

     

    <CLEARVAR1:T:20:21><REM2:Get Main Folder 1 and 2 Path from Registry><REGRSTR:20:HKEY_CURRENT_USER\Folder F><REGRSTR:21:HKEY_CURRENT_USER\Folder S><REM2:Select Main Folder and save it to Registry (First Time Run)><IFVAR2:1:20:1:><TVAR2:20:10:~ Please Select the Folder that contains the Files ~><REGWSTR:20:HKEY_CURRENT_USER\Folder F><ENDIF><IFVAR2:1:21:1:><TVAR2:21:10:~ Please Select the Folder that contains the Subfolders ~><REGWSTR:21:HKEY_CURRENT_USER\Folder S><ENDIF><DIS:<TBOX4:T:1:000373000269000409000157:000:Folder F S%T20%
    -
    %T21%><REM2:Get Full File Path (T10)><REP3:07:000002:000001:0010:0:01:%T20%><REM2:Get File Name (T1)><REP3:07:000001:000001:0001:0:01:%T20%><DIS:<TBOX4:T:1:000373000269000409000157:000:-%T10%
    -
    %T1%><IFVAR2:4:10:7:T1T><BREAK><ENDIF><ENDREP><REM2:Get First Word (Folder Name) from T1 to T2><IVAR2:01:13:1: ><TMVAR2:10:02:01:001:N01:><TMVAR2:13:02:00:000:000:><TMVAR2:01:02:00:000:000:><DIS:<TBOX4:T:1:000373000269000418000173:000:Done%T10%
    -
    %T1%
    -
    %T2%><REM2:Move File><IFOTH:02:1:%T21%\%T2%><AND><IFOTH:09:2:%T21%\%T2%\%T1%><DOFILE:07:NN:%T10%>%T21%\%T2%\%T1%><ENDIF><ENDREP>

     

    What will this macro do:

     

    It will take the First word of every file that are inside the "Files Folder" and move them to the Folder that contains the Subfolders (Excel, Word, PDF, Access, whatever) that matches the said word.

     

    It will move only those files whose first filename word matches with an existing folder.

     

    It will NOT watch for files that already are inside the Folder that Contains the Subfolders.

     

     

    Uhm.. lets say:

     

    · You have a Folder that contains the files: "Word data.doc" and "PDF guide.pdf"

    · You have another folder that contains the subfolders: "Word" and "PDF"

     

    ME will take the two Files and move them, based on the first word of each one, to the Folders.

     

     

    It was fun to make it.

     

    If it works for you, you can learn some looking at the Script.

     

    Good luck!

     

    PS: IF you want to be asked Again for those 2 folders, use this macro:

    <REGDELVAL:HKEY_CURRENT_USER\Folder F><REGDELVAL:HKEY_CURRENT_USER\Folder S>

     

    PS2: hope you can understand me better than I do :rolleyes:.

  2. Here is a simple sketch of the macro you need

     

    1) First you should use "Repeat with Folder" with

    Return: Files

    "Full File Path" selected

    "Process Subfolders" ON

     

    and choose the Main Folder wich contains the other subfolders: Excel, Word, etc.

     

    This will, one by one, place on a variable (lets say T10) the Full File Path of all the files inside the Main Folder (including those wich are inside the subfolders Excel, Word and the others)

     

     

    2) Now you need to get the File Name wich is placed at the last part of the Full Path.

     

    Something like this should work:

     

    <IVAR2:10:12:10><REP3:08:000007:000001:0001:0:01:\><NMVAR:09:10:0:0000001:0:0000000><TMVAR2:10:01:10:N10:9999:><ENDREP><TMVAR2:21:01:00:000:000:\>

     

    T1 will contain the File Name now.

     

     

    3) The next step is to retrieve the first word of the File-Name from T1 to T2

    You should use the command "Get Position of Text in a Text Variable" as Joe said.

     

     

    4) Finally, use Switches and Cases to read T2 and move the file.

     

    Here is a base example:

     

    <SWITCH:T2><CASE:excel><DOFILE:07:NN:%T10%>Main Folder Path\%T1%><ENDCASE><ENDSWITCH>

     

     

    Hope this helps some.

  3. Hello

     

    I think you would need to use Switches and Cases. Here it is an example:

     

    Switch (T3)

    // Cases are like "If Variable = X

    Case: ADABAS

    Delay 200 Milliseconds

    Text Type: CSC.CPH.GPES.DBA.ADABAS

    End Case

    Case: 8781

    Delay 200 Milliseconds

    Text Type: CSC.Cph.Ops.Data.Tsmd

    End Case

    // If any of the others:

    Default Case

    Delay 200 Milliseconds

    Text Type: XXXXXXXXX

    End Case

    End Switch

     

    If T3 it is only contains the triggering text (eg: T3 = "abcText ADABAS") you could try something like this:

     

    Variable Set Integer %N1% to 0

    If Variable %T3% contains "ADABAS"

    Delay 200 Milliseconds

    Text Type: CSC.CPH.GPES.DBA.ADABAS

    Variable Set Integer %N1% to 1

    End If

    If Variable %N1% = 0

    Delay 200 Milliseconds

    Text Type: XXXXXXXXX

    End If

  4. The pop-up window is not separated from the web browser then? Guess you can't use Controls neither.

     

    Does the pop-up appear always in the same place?

     

    I don't see why the script you posted wouldn't work.

    It checks the color before the popup appears, but it will only click if the pixel color becomes 3421493..

  5. Here is how it would work:

     

    - Mail from celular to pc with a command

    - Computer checks mail every 1 minute

    - When mail arrives email client runs a macro wich uses controls to get the command

    - The macro recognizes the command (eg: If Variable %T1% contains "Restart")

    - The commnd is done

    - An email is sent to the celular to inform the command was done.

     

    I use POP Peeper (http://www.poppeeper.com/) with the "Chime" Plugin (http://www.poppeeper.com/Plugins/notify.php)

     

     

    Some Cmds I have:

     

    · Word translator

    · Encyclopedia

    · Restart/Turn off PC

    · Run a program

    · Send weather prognostic

    · Inform about downloads finished

  6. Hello

     

    I know this is not a Visual Basic Script forum, but I was wondering if someone with knowledge could give me a hand with a very simple macro/script.

     

    This is how it would be in ME:

     

    Repeat Until %N1% <> %N1%

    If Window Title "Main battery Full" is on top

    Macro Stop

    End If

    Wait For Window Title: "Main battery low"

    Window Close: "Main battery low"

    Repeat End

     

    This is what I have done so far

     

     

    for x=1 to 100

    Window.WaitWindow (Main battery low)

    Window.CloseWindow(?) "Main battery low"

    next %>

     

    Of course it won't work. I have no idea what to do with the "Sub Main", "Call main" and "functions" I'm reading a tutorial, but I dont think I will ever do a VBScript again :P

     

    Long Life to Macro Express!

  7. No problem, pat!

     

    I just like to search new challenges. That way I can help someone and learn myself too!

     

    In my case, I started with basic macros (just as click somewhere, press some keys, open/close windows, etc). Then I learnt about Variables and their variety of uses. Finally I started using Controls.

     

    I remember taking a look to every feature in ME and trying to figure their uses. The Incorporated help files are awesome to learn too!

  8. You know.. I read your first post again and finally realized/understood what is what you want (I guess I don't need to say that my english isn't very good)

     

    The 2 macro I first posted move the "Rates -Day" folder to the "Old Rates" folder Every Day and then creates a new folder for the current day...

     

    Well this one really does what you need...

     

    <VSETMISC:T9:Username><DT:ddd MMM-dd-yyT:01:1:><IFOTH:10:1:C:\Documents and Settings\%T9%\Desktop\Old Rates><DOFILE:02:NN:C:\Documents and Settings\%T9%\Desktop\Old Rates>><ENDIF><REM2:Monday Routine><DT:dddT:10:1:><IFVAR2:1:10:7:Mon><IVAR2:02:01:1><REP3:01:000001:000001:00007:0:01:><DT:ddd MMM-dd-yyT:02:3:{P0%N2%}{P00000}{P00000}{P00000}><IFOTH:02:1:C:\Documents and Settings\%T9%\Desktop\Rates -%T2%><DOFILE:03:NN:C:\Documents and Settings\%T9%\Desktop\Rates -%T2%>C:\Documents and Settings\%T9%\Desktop\Old Rates\Rates -%T2%><ENDIF><NMVAR:08:02:0:0000001:0:0000000><ENDREP><DOFILE:02:NN:C:\Documents and Settings\%T9%\Desktop\Rates -%T1%>><ELSE><REM2:Not-Monday Routine><IFOTH:10:1:C:\Documents and Settings\%T9%\Desktop\Rates -%T1%><DOFILE:02:NN:C:\Documents and Settings\%T9%\Desktop\Rates -%T1%>><ENDIF><ENDIF>

     

    Hope it works!

    *You should set it to run every day you want a folder to be created.

    *It will Move all Old Rates on Monday

  9. Hi again :)

     

    I made some modifications. Now the macro should work, no need to change anything.

     

    Just schedule it to run every day

     

    Here it is

     

    <VSETMISC:T9:Username><Mmm DD YY{NP001}{P000}02><IFOTH:10:1:C:\Documents and Settings\%T9%\Desktop\Old Rates><DOFILE:02:NN:C:\Documents and Settings\%T9%\Desktop\Old Rates>><MSD:100><ENDIF><IFOTH:02:1:C:\Documents and Settings\%T9%\Desktop\Rates -%T2%><DOFILE:03:NN:C:\Documents and Settings\%T9%\Desktop\Rates -%T2%>C:\Documents and Settings\%T9%\Desktop\Old Rates\Rates -%T2%><MSD:100><ENDIF><Mmm DD YY{NP000}{P000}01><MSD:100><DOFILE:02:NN:C:\Documents and Settings\%T9%\Desktop\Rates -%T1%>>

     

    P.S: If you see that the old rates folder is moved but the today's rates folder is not created try making Right Click on your Desktop and then pressing "Refresh"

  10. Hello!

     

    I've got the solution right here!

     

    You only have to make sure to copy the lines one by one to the clipboard so the macro can split them.

     

    - This macro is Bulletproof! :P

     

    <REM2:Hello there - Strathos><TVAR2:04:03:><TMVAR2:01:04:00:000:000:><REM2:Get First Name><IVAR2:04:13:4: ><NMVAR:09:04:0:0000001:0:0000000><IFVAR2:2:04:3:0><TBOX4:T:1:CenterCenter000278000200:000:Error:Only 1 Word Detected...
    
    T4:
    %T4%><MSTOP><ENDIF><TMVAR2:10:01:04:001:N04:><TMVAR2:11:04:00:001:N04:><TMVAR2:01:01:00:000:000:><TBOX4:T:1:CenterCenter000278000200:000:First Name:%T1%><REM2:Get Last Name><IVAR2:04:12:4><IVAR2:03:01:%N4%><REP3:08:000007:000001:0003:0:01: ><NMVAR:09:03:0:0000001:0:0000000><TMVAR2:10:03:04:N03:N04:><DIS:<TBOX4:T:1:CenterCenter000278000200:000:Working...Detecting:
    
    %T3%
    
    - %N3%><ENDREP><TMVAR2:11:04:00:N03:N04:><TMVAR2:01:03:00:000:000:><TBOX4:T:1:CenterCenter000278000200:000:Last Name:%T3%><REM2:Get Middle Name><TVAR2:02:01:%T4%><TMVAR2:01:02:00:000:000:><TBOX4:T:1:CenterCenter000278000200:000:Middle Name:%T2%>

  11. Hello blimey

     

    I think you have to use Switches and Cases.

     

    This is how I would do it:

     

     

    Repeat Until %T2% = "OK"

    Multiple Choice Menu: Choose!

    Text Box Display: Answer

    Switch (T1)

    // IF Correct :)

    Case: AC

    Variable Set String %T2% "OK"

    Text Box Display: Correct!

    End Case

    Case: AD

    Variable Set String %T2% "OK"

    Text Box Display: Correct!

    End Case

    Case: BC

    Variable Set String %T2% "OK"

    Text Box Display: Correct!

    End Case

    Case: BD

    Variable Set String %T2% "OK"

    Text Box Display: Correct!

    End Case

    // IF Wrong

    Default Case

    Text Box Display: Incorrect!

    End Case

    End Switch

    Repeat End

    Text Box Display: Finished

     

     

    <REP3:08:000001:000001:0002:0:01:OK><MENU2:2:F:01:CenterCenter:Choose!Correct Answers:
    AC AD BC BDA
    B
    C
    D><DIS:<TBOX4:T:1:CenterCenter000278000200:000:Answer%T1%><SWITCH:T1><REM2:IF Correct :)><CASE:AC><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><CASE:AD><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><CASE:BC><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><CASE:BD><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><REM2:IF Wrong><DEFCASE><TBOX4:T:1:CenterCenter000278000200:000:Incorrect!: (><ENDCASE><ENDSWITCH><ENDREP><TBOX4:T:1:CenterCenter000278000200:000:Finished>

  12. Hello Joe

     

    I always knew that I could change settings within IE. I just didnt want ME to go to Tools->Internet Options->Advanced and Multimedia Twice every time I needed that webpage to load (after all it was to make things quicker).

     

    The solution I posted is basically changing the IE settings writing on the Window's Registry

     

    Thanks for your time,

     

    Strathos.

×
×
  • Create New...