Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by stevecasper

  1. Hey Terry,

     

    What a fantastic idea... I had never considered putting a Macro Run command inside a Repeat Loop before. I generally

    do the Macro Run and put the repeats inside the macro I'm running, but this is a different perspective that could have

    immense benefits (such as when I want to call the same macro from another source that doesn't need to be repeated...).

     

    I'm not sure I have any macros that would benefit from that right now, but it's definitely something I'm going to consider.

     

    And this is why I hang out in the forum.

  2. Hi Pat,

     

    I personally have never written anything to the registry, so I don't know how it works (and I'm kind of scared to try), so if you're

    comfortable with it, then by all means ignore my response.

     

    If I use a multiple choice menu, and want to have my selection remembered for the next time it runs, I generally just save the variable

    with the Save All Variables command, and Restore All Variables before we get to that prompt. For example:

     

    Variable Restore All Variables
    If Variable %T1% = ""
     Variable Set String %T1% "Mon"
    End If
    Multiple Choice Menu: This Test Is For Pat
    Text Box Display: Your Selection:
    Variable Save All Variables

     

    <VARSR:05><IFVAR2:1:01:1:><TVAR2:01:01:Mon><ENDIF><MENU2:1:T:01:CenterCenter:This Test Is For PatPlease select an optionMon
    Tue
    Wed
    Thu
    Fri
    Sat
    Sun><TBOX4:T:1:CenterCenter000278000200:000:Your Selection:%T1%><VARSR:01>

     

    If you are using a check-box menu, and want to set the default to multiple selections, say Monday and Tuesday, you just string the selections

    together in the Set String command like this: Variable Set String %T1%"MonTue" You can string them in any order, and it will work fine.

     

    Of course, when you restart ME, this will reset %T1% back to nothing, and you will have to be careful with any other macros that may use

    the Variable you're saving. You can still use it, you just can't save the variable in question in a different macro or you'll lose this saved

    information... and if you end up with something that isn't on the list, you'll end up with no selection at all in your multiple choice.

     

    Now, if you want the macro to remember the selection from day to day or relaunch to relaunch of ME, it gets a tad more complicated

    (though not too bad). This is where I would save my selections to a text file buried somewhere on my hard drive, and then use a process

    file command to recall previous selections. I think this was one of Cory's suggestions.

     

    Same macro, recalling from run-to-run:

     

    Variable Set String %T2% "C:\Users\Steven\Documents\Macros\Macro Test Files\MultiChoicePathForPat.txt"
    If File Exists "%T2%"
     Text File Begin Process: "%T2%"
     Text File End Process
    End If
    Multiple Choice Menu: This Test Is For Pat
    Variable Modify String: Save %T1% to Text File
    Text Box Display: Your Selection:

     

    <TVAR2:02:01:C:\Users\Steven\Documents\Macros\Macro Test Files\MultiChoicePathForPat.txt><IFOTH:01:2:%T2%><BTFBEG:001:000001:000000:%T2%><BTFEND><ENDIF><MENU2:1:F:01:CenterCenter:This Test Is For PatPlease select an optionMon
    Tue
    Wed
    Thu
    Fri
    Sat
    Sun><TMVAR2:17:01:00:000:000:%T2%F><TBOX4:T:1:CenterCenter000278000200:000:Your Selection:%T1%>

     

    The only problem is this: If you are tracking what work has been done throughout the week, for example, and when you finish one task

    you are running the macro to check that it has been done, and you need it to reset at the beginning of the week each week, you're going

    to need to write a bit more code to make that happen.

     

    Here is what I would do, based on my limited understanding of what you're trying to do and on what I have done with some of my macros:

     

    // First, Set Variables With Paths to the Saved Text Files
    Variable Set String %T2% "C:\Users\Steven\Documents\Macros\Macro Test Files\MultiChoicePathForPat.txt"
    Variable Set String %T3% "C:\Users\Steven\Documents\Macros\Macro Test Files\NewWeek.txt"
    // Set Today's Day of Week to a Variable
    // If Today is Monday (or beginning of work-week) the Following Code Will
    // Determine Whether or Not the Multiple Choice Member Resets
    Date: Save Day of Week 1 (Mon) into %T5%
    If Variable %T5% = "Mon"
     If File Exists "%T2%"
    If File Exists "%T3%"
      Text File Begin Process: "%T3%"
      Text File End Process
      // The Following Prompt Gives the User the Option to Clear the Multiple Choice Menu or Not
      // This Prompt Will Only Come Up the First Time the Macro Runs on Monday
      If Variable %T4% <> "Yes"
    	If Message: "Test Prompt to Reset Check Boxes"
    	  Delete File or Files: "%T2%"
    	End If
      End If
    End If
    Variable Set String %T4% "Yes"
    Variable Modify String: Save %T4% to Text File
     End If
    End If
    // If Today Is NOT Monday, the Following Code Will Ensure That On 
    // Monday (or beginning of week) the Multiple Choice Menu Will Get Reset
    If Variable %T5% <> "Mon"
     Delete File or Files: "%T3%"
    End If
    
    // And Here Is the Functional Macro
    If File Exists "%T2%"
     Text File Begin Process: "%T2%"
     Text File End Process
    End If
    Multiple Choice Menu: This Test Is For Pat
    Variable Modify String: Save %T1% to Text File

     

    <REM2:First, Set Variables With Paths to the Saved Text Files><TVAR2:02:01:C:\Users\Steven\Documents\Macros\Macro Test Files\MultiChoicePathForPat.txt><TVAR2:03:01:C:\Users\Steven\Documents\Macros\Macro Test Files\NewWeek.txt><REM2:Set Today's Day of Week to a Variable><REM2:If Today is Monday (or beginning of work-week) the Following Code Will><REM2:Determine Whether or Not the Multiple Choice Member Resets><Day of Week 1{NP000}{P000}05><IFVAR2:1:05:1:Mon><IFOTH:01:2:%T2%><IFOTH:01:2:%T3%><BTFBEG:004:000001:000000:%T3%><BTFEND><REM2:The Following Prompt Gives the User the Option to Clear the Multiple Choice Menu or Not><REM2:This Prompt Will Only Come Up the First Time the Macro Runs on Monday><IFVAR2:1:04:2:Yes><IFMESS3:00000:1:1:Test Prompt to Reset Check BoxesIs it a new week? Should I reset the check boxes to empty?Center:Center><DOFILE:08:NN:%T2%>><ENDIF><ENDIF><ENDIF><TVAR2:04:01:Yes><TMVAR2:17:04:00:000:000:%T3%F><ENDIF><ENDIF><REM2:If Today Is NOT Monday, the Following Code Will Ensure That On ><REM2:Monday (or beginning of week) the Multiple Choice Menu Will Get Reset><IFVAR2:1:05:2:Mon><DOFILE:08:NN:%T3%>><ENDIF><REM2:><REM2:And Here Is the Functional Macro><IFOTH:01:2:%T2%><BTFBEG:001:000001:000000:%T2%><BTFEND><ENDIF><MENU2:1:F:01:CenterCenter:This Test Is For PatPlease select an optionMon
    Tue
    Wed
    Thu
    Fri><TMVAR2:17:01:00:000:000:%T2%F>

  3. Weird behavior happening with boxes. I click on the Text Type command to bring up the command box and it looses focus and disappears behind the Scripting Editor Window. I have to do an Alt Tab to bring it back on top. Some times I have to do the alt tab three times to get the box to remain on top of the Scripting Editor window. Can any one tell me what is going on? It is as if the Scripting Editor window does not want to give up focus. It is happening with all of my boxes. :blink:

     

    My first thought is that there is a macro built with "Window Title" set as it's activation, and the title it's looking for is either text or type or both... I don't know why that would call the scripting editor to the front, unless the macro running is supposed to activate a window with words in the title bar that match some/all of the words in the title bar of the macro you're trying to edit.

     

    My next thought is that it's something similar to what I described, but fundamentally different. I would suggest watching the ME logo in your task bar and see if the running man appears when you open a Text Type window. If the macro running it is short, you still may not notice the change, it will go so quickly, but if you do see him, you'll know you have your culprit. Now to figure out which macro you wrote that would do such a thing...

     

    If you are certain that this is not the problem, then I'll just bow out because I wouldn't know where else to begin.

     

    --- EDIT

     

    Scratch that... I just tried to get my Scripting Editor to pull in front of the Text Type window and was unable to do it. My ME refuses to let the TT edit box slip behind the Editor.

     

    I bet the ME guys would like to know what version of ME you're running, on what system, etc. This definitely sounds like an annoying nuisance. Good luck!

  4. Thank you, Steve, that's just what I needed to know. You must be a mind reader, because you anticipated exactly what I want to do -- write several variables per line, separated by commas, with cr/lf for each line.

     

    P.S. Now I don't need to know how big a string variable can be, because I can write them out to disk as I build them. I was afraid I would have to accumulate thousands if short strings by appending them to a string variable, then "type" the whole thing into a Notepad file.

     

    Yikes! I'm glad I could help you avoid that mess!

  5. Two questions:

    1) Is there a way to write directly to a text file with ME? I'm looking for the opposite of ASCII File Begin Process or Text File Begin Process. I can't seem to find any such command, but hoping I am just overlooking it....

    2) How big can a string variable be?

     

    You can use Modify Variable String to Save or Append to a text file (Save to create a new file, Append to add to an existing one).

     

    If you're appending a list, you will want to make sure the last item appended per line has "Add Trailing CR/LF" checked. I mention this because you said you are looking for the opposite of an ASCII File Begin Process, where each item from the delimited file will be assigned to different variable by increments, so if you want the opposite, I imagine you may want to have multiple variables added per line.

     

    Example:

    Text file: "My Sons Sports.txt"

     

    John, Baseball

    Jim, Basketball

    Terry, Football

     

    ASCII File Process will assign John to %T1% (for example), Baseball to %T2%, then on its next pass, Jim gets %T1% and Basketball gets %T2%, etc.

     

    The opposite, adding my nephews to the list, I'll use Modify String Variables to append to the text file, setting %T1% as "Corbin", %T2% as Soccer, then appending %T1% to the file, followed by %T2%, and when I append %T2% I will Add Trailing CR/LF so that when I do the next %T1% (Garrett), it will be on the line below Corbin, rather than on the same line and following Soccer.

     

    Also, you'll want to append necessary separators to each variable that you're adding (such as a comma and space, as in my example below - this may not be necessary if you are appending to a Comma Delimited Text File AKA a .csv).

     

    Here's my example:

     

    Variable Set String %T1% from Prompt
    Variable Modify String: Append ", " to %T1%
    Variable Set String %T2% from Prompt
    Variable Modify String: Append %T1% to Text File
    Variable Modify String: Append %T2% to Text File

     

    <TVAR2:01:02:FWho?FFCenter:Center><TMVAR2:07:01:00:000:000:, ><TVAR2:02:02:FWhich Sport?FFCenter:Center><TMVAR2:20:01:00:000:000:C:\Users\Steven\Documents\Macros\Macro Test Files\My Sons Sports For rberq.txtF><TMVAR2:20:02:00:000:000:C:\Users\Steven\Documents\Macros\Macro Test Files\My Sons Sports For rberq.txtT>

  6. This sounds a lot like a problem I've been having with Controls. Why would the control change, though, when nothing

    about the program has? Sometimes it's just a new day.

     

    It's tremendously irritating, but if it's not a ME problem, then it's a computer problem, in which case, it's a common

    computer issue. I've had these problems happen on IE 6.x controls, Access database controls, and a few others. I have

    had it happen on computers running XP Professional and Vista 32. We'll see if it happens on a Vista 64 soon enough.

     

    Other than the work-around presented by having a string of "If/Thens", is there any other way that anybody can think of

    to prevent or anticipate this problem?

     

    Just for reference, this is the code that brought me into the forum today. The top one with 004:20 works today, the bottom

    one with 004:19 worked for me the other day but no longer - if I manually change the 19 to 20, it works again, so I'm

    certain that is the offending bit of code... Can anybody with more practical programming knowledge explain to me

    what that particular bit of information is, so that I can understand what the difference is, and what may be causing the

    change?:

     

    <GETCONTROL2P:01:MSACCESS.EXE:OMainMicrosoft Access - JacksonYP09 : Database (Access 2000 file format) - [Listings]004:20MDIClient1OForm22OGrid2OKttbx>
    <GETCONTROL2P:01:MSACCESS.EXE:OMainMicrosoft Access - JacksonYP09 : Database (Access 2000 file format) - [Listings]004:19MDIClient1OForm22OGrid2OKttbx>

  7. Hello all!

     

    I am trying to get ME to tell me what the total pixel area is on the screen.

     

    For example, top left = 0,0 top right 1279, 0

    bottom left = 0, 1023 bottom right = 1279, 1023

     

    Is there anyway for macro to tell me these on any screen by doing a search?

     

    Thanks!

     

    Pat

     

    Area = (Length)(Width)

     

    Fortunately, Macro Express gives us the tools to find both Height (Length) and Width of either your

    screen or the window of your choosing in the Variable Set Integer command.

     

    Then with a basic multiplication function found in the Modify Integer command, you can calculate

    the total pixel area of either your screen or your window.

     

    // To Collect total pixel area on the screen do the following:
    Variable Set Integer %N1% from Screen Width
    Variable Set Integer %N2% from Screen Height
    Variable Modify Integer: %N3% = %N1% * %N2%
    Text Box Display: Total Pixel area...
    // To Collect total pixel area on any give window do this:
    Variable Set Integer %N1% from Width of Window
    Variable Set Integer %N2% from Height of Window
    Variable Modify Integer: %N3% = %N1% * %N2%
    Text Box Display: Total Pixel area...

    <REM2:To Collect total pixel area on the screen do the following:><IVAR2:01:14:><IVAR2:02:15:><NMVAR:03:03:1:0000001:1:0000002><TBOX4:T:1:CenterCenter000278000200:000:Total Pixel area......of screen
    %N1% Pixels Wide
    %N2% Pixels High
    %N3% = Total Area><REM2:To Collect total pixel area on any give window do this:><IVAR2:01:09:><IVAR2:02:10:><NMVAR:03:03:1:0000001:1:0000002><TBOX4:T:1:CenterCenter000278000200:000:Total Pixel area......of window
    %N1% Pixels Wide
    %N2% Pixels High
    %N3% = Total Area>

  8. I can't think of a way to password protect a text file. However, you could use the File Attribute command to mark it as read only. This would allow them to look at it, but not modify it unless they go into the properties and remove the Read Only flag. This is not a true solution, but more of a deterrent.

     

    You could also use the File Attribute command to mark the file as hidden. Again, not a true solution, but it would hide the file unless they have the Show Hidden Files option selected in their File Explorer.

     

    This is good. I checked it out and the error message I get when I try to edit the text file through the Load Macro Text File command seems familiar enough to be the error I used to get when I was just the little guy trying to learn from other people's macros.

     

    I think hiding and making files read only should be enough for my little project. Anybody who understands immediately what the problem is and knows how to get around it is probably smart enough not to. Anybody who is determined enough to figure it out the hard way is also likely to be.

     

    I'll just make sure I also back up all the .txt files on my C drive any time I update the group macros, just in case.

     

    Thanks for all the help and explanations. This is going to be fantastic!

  9. The way this works is to separate your macro(s) into one part that will never change and another part that will change. Each 'never change' macro contains one or more Load Macro Text File" commands. Put the 'never changed' macros in the user's main macro file and put the external changeable macros into a specific directory location. Another process outside of Macro Express (such as a batch file, a 'push files' or synchronize program) can update the changeable macros at will.

     

    Ok, I've toyed with this and it seems to be working so far. Through trial and error I discovered that the Text File being loaded actually has to be a text file (you'd think that would have been obvious), so I've used the Direct Editor script, saved it as a .txt and placed it on the department's Group drive.

     

    I was wondering, though, if there is any way to write-protect a .txt file or the folder it is in to prevent mischievous snoops from digging it up and messing around with it?

     

    Or is there another mystical way to do this, so that if they wanted to look at it to learn they could, but just not mess it up?

  10. Kevin,

     

    Would your answer be the "workaround" I mentioned? If so, can you please explain how to do it?

     

    Thank you!

     

    Pat

     

    My mother-in-law is programming-illiterate in every sense of the word, however she works from home doing data entry.

    Occasionally, she needs to enter the same ridiculously tediously long names into her Access file so she was keeping

    them in a notepad and doing copy-paste work to avoid having to type names like Susquahennah-Los Pequeninhos

    Drive over and over sporadically throughout the day.

     

    I introduced her to Macro Express and simple shortkey routines. She bought the program.

     

    Unfortunately, she can't program and the obscenely long names aren't always the same from week-to-week. I can't come

    running over to her house every time she gets a new annoying name, so I built a macro for her that takes her systematically

    through all the steps of creating a new macro. At first it was a simple step-by-step Text Box Display instruction format, but

    it didn't take me long to see how much easier it would be for her if I just had a prompt requesting the name she wanted to

    save and the shortkey shortcut she would be using for it.

     

    Then I built the macro to Activate the ME Editor, Create a new macro, code the new text, and set the shortkey.

     

    It's really just a matter of patiently trying to figure out how many tabs to get from one field to another, making sure the timing

    is right (putting delays where necessary), and basically just knowing what it is you would do manually to create the macro, then teaching a macro how to do it.

  11. "... but when I changed the window to any other window, the Activation

    Window (Macro Express Forums) pulled itself back to the front and the macro ran again"

     

    SCASPER, I have a Citrix application that opens and closes (or doesn't close) half a dozen different windows, and each window has its own macro tied to the window title. What I have seen is, when the application switches from one window to another, one of the other windows may become "on top" for a brief instant and its macro will run again. It's an intermittent problem, it may work perfectly ten times in a row and fail the eleventh. I had to set variables indicating which window should REALLY be active; and the first thing each macro does is check whether it is really supposed to be running or not, and simply stop if it isn't.

     

    I don't know whether you are seeing a similar phenomenon, and I'm not sure how to account for it happening only once. One theory for the "once only" is that it is a caching issue -- that is, the first time you switch to another window, the related programs and data may have been paged out of memory, and during the page-in time the original (macro-activating) window briefly gains focus again. The next time you switch perhaps everything is in core and the switch happens cleanly. I would be interested to know whether your extra macro runs are 100 percent consistent, or intermittent.

     

    That's probably it. I was at work when I was having that problem, now that I'm home I'm not able to duplicate it. We use Citrix at work for some stuff, so maybe it was misbehaving.

  12. I'm not very familiar with scripts (I just started toying with them about 2 days ago),

    so this may not help you at all.

     

    However, with Macro Express, I have macros that do something similar to what you

    described, and when it gets to the end of a list after tabbing through, I am able to get

    it to stop by using a comparison.

     

    Example, %T1% collects "DATA001", then it collects "DATA002", etc. Well if there are

    5 pieces of data, let's say, it will eventually collect DATA005, then the next run will collect

    DATA005 again, which is what we want to avoid, so to prevent that I do the following.

     

    Variable Set String %T1% ""
    Variable Set String %T2% ""
    Repeat Until %T1% <> %T1%
     // ->Change this Remark to whatever command you will use to collect Data001 etc. and then set that data to %T1% <-
     If Variable %T1% = variable %T2%
       Break
     End If
     Variable Set String %T2% "%T1%"
     // -> Add any additional code here (such as <TAB> or <ARROWD> or whatever) <-
    Repeat End

     

    Of course, this doesn't have to be Repeats, it could be Text File Process, etc.

     

    Again, I don't know very much about scripts at all, so I'm not sure if this helps, but if it does,

    I'm glad to have been of service!

  13. FOLLOW UP

    Ok, I did have an unexpected problem, and by unexpected I mean that it isn't even what you had described.

     

    When I set to Window Title as the Activation, the macro ran, and it ran right. When running with the Repeats,

    it ran exactly as it should have; but when I ran it without the repeats, it ran once, finished, and I thought that

    was fine, exactly what I expected... but when I changed the window to any other window, the Activation

    Window (Macro Express Forums) pulled itself back to the front and the macro ran again. This would only

    happen once. The next time I tried leaving the window, I was able to without getting yanked back. If I

    manually returned to the ME Forums page, the macro would run, and pull me back again when I left the page...

    again, just once. Very strange behavior.

     

    However, based on the problems you've described I observe the following possibilities:

    • You're expecting a macro to run over and over without repeats when set to Window Title as Activation, and
      when that window remains on top.
    • There is a bug specific to your version or your computer that isn't affecting me (ME vers. 3.7d)
    • The windows you are selecting have a type-o somewhere (not likely if you're selecting from the Browse button)
    • Or Something else entirely that I didn't think of.

    If it's the first one, I'm pretty sure ME is designed specifically not to run the macro more than once per

    visit to the particular window in question. It would get VERY bothersome if you just needed the macro to run once

    when a window came to the front, but kept going over and over and over. Especially since it's pretty simple to build

    a repeat cycle into a macro to keep it going as long as the window is on top.

     

    And yet, I wonder if an option in the Activation menu to auto-repeat as long as the window is on top would be a

    good option for a future build of ME. Something to suggest, anyway.

  14. Thanks Scaspar and rberg!

     

    Can anyone, you, rberg etc, try to see if you are having the same problem as me?

     

    Here it is:

     

    Use Mouse click(in the Properties Tab) and choose an area/part and try it(keep the Scope global).

    Then add a Scope condition such as Window Specific or Program Specific, and see if it works.

     

    Hi Pat,

     

    I built the following very simple macro and tested it thus:

     

    • In Region - Left: 702, Top: 2; Right: 1016, Bottom: 234

    Scope Results

    1. I first selected Global
    2. Then I selected Window Specific (for the purpose of the test I used "Macro Express Forums as my
      specific window).

    The Macro ran, as expected, when I clicked in the defined region. When set to Global, it ran on every

    window I tested it on; when set to Window Specific, it only ran on the Macro Express Forums window.

     

    I then ran a second test with the Repeat modifications shown in the second set of codes down below,

    with similar results. The second set of code includes the repeat discussed in a previous reply, where

    the macro runs continuously once started until the window in question is no longer on top (please note,

    my test makes use of a text box which I have set to remain on top, but NOT keep focus - results may

    vary with different settings).

     

    TEST 1:

        Text Box Display: Hi, 
       Delay 1 Seconds
       Text Box Close: Hi, 

     

    <TBOX4:F:6:CenterCenter000128000085:001:Hi, This is a test.><DELAY:1><TBCLOSE:Hi, >

     

    TEST 2:

    Repeat Until %T1% <> %T1%
     If Window Title "Macro Express Forums" is on top
       Text Box Display: Hi, 
       Delay 1 Seconds
       Text Box Close: Hi, 
     Else
       Break
     End If
    Repeat End

     

    <REP3:08:000002:000001:0001:1:01:T1><IFOTH:03:2:Macro Express Forums><TBOX4:F:6:CenterCenter000128000085:001:Hi, This is a test.><DELAY:1><TBCLOSE:Hi, ><ELSE><BREAK><ENDIF><ENDREP>

     

    I'll run the test again with Window Title set as the launch, but I expect similar results. If I do experience

    any unexpected problems, I'll be sure to post a follow-up.

  15. It seems like the Window Title only works once and that\'s it. What makes Windows cause the Window to be

    active continuously?

     

    What rberq suggested would look something like this (with whatever modifications you might need specifically

    for your situation):

     

    Repeat Until %T1% <> %T1%
     If Window Title \"Specific Window\" is on top
       // Macro Code Here
     Else
       Break
     End If
    Repeat End

     

    <REP3:08:000002:000001:0001:1:01:T1><IFOTH:03:2:Specific Window><REM2:Macro Code Here><ELSE><BREAK><ENDIF><ENDREP>

     

    If you read this before I edited it, sorry, I completely misunderstood the question the first time.

  16. Hey Scasper!!!!

     

    Since you helped me with my problem, I will help you.

     

    The Scripting Guys! The Scripting Guys!

     

    http://www.microsoft.com/technet/scriptcen...qanda/htas.mspx

    http://www.microsoft.com/technet/scriptcen...bs/default.mspx

     

    You just need to look at HTML Applications, but trust me. I've been using VBScript with Macro and Applications for a little bit now and they are great!!!!!!!!

     

    Thanks!

     

    -P

     

    2 other things. The extension is .hta and if you look at the Third party Tools in macro Express's forums, the HTA is the second one on the list. This will show you how to do a self containing HTA.

     

    If you need the script to turn your HTA into a "straight string" to load into "variable set string - Set Variable Now" let me know, I will post it.

     

     

    Sweet! I love learning new stuff... and this looks like there is a lot of stuff to learn :). Once I get a grasp of what I'm learning, I'll be sure to let you know if I need the script you mention. Thanks Pat!

  17. The way this works is to separate your macro(s) into one part that will never change and another part that will change. Each 'never change' macro contains one or more Load Macro Text File" commands. Put the 'never changed' macros in the user's main macro file and put the external changeable macros into a specific directory location. Another process outside of Macro Express (such as a batch file, a 'push files' or synchronize program) can update the changeable macros at will.

     

    Cool, thanks Kevin!

     

    This is going to save me a lot of trial and error... not all of it, since I can't seem to build any macros without at least some (aka a lot) of errors, but this should help me skip some of the earliest and most obvious blunders I am generally bound to make.

     

    I'll have to play with this a little bit and see if I can't break something :)

  18. Here is a slightly more elaborate way to change your "Lastname, Firstname" to a "Firstname Lastname", also removing

    any unwanted second parties. If there is a second person, it MUST be separated by an ampersand for this particular

    macro to eliminate it, though if a different separator were to be used, it is a simple modification of the "Set Integer from

    Position of Text" command.

     

    Why this one is more elaborate is because it does more than just get rid of the comma and switch the names around, it

    also creates a .csv file that can be opened in your spreadsheet application, and even saved as an .xls... assuming you

    were ever to want to collect these names in that way. This macro only goes far enough to create the .csv file, but it

    shouldn't be hard to add one more "Copy File or Files" command to create the .xls.

     

    The one drawback about this particular method, or at least as far as I built this macro, is that T1 remains the Lastname,

    and T2 becomes the Firstname, but that shouldn't be a problem to switch around at the end. This also puts the last name

    in the first column of the .csv file and the first name in the second column. To fix that, there would need to be code to

    switch them before they are put into the .csv. Probably the code that Cory gave originally.

     

    Anyway, here it is, for anybody who is interested:

     

    Variable Set String %T1% "Parker, Fred & Parker, Joan"
    Variable Set Integer %N1% from Length of Variable %T1%
    Variable Modify Integer: %N1% = %N1% + 1
    Variable Set Integer %N2% from Position of Text in Variable %T1%
    Variable Modify Integer: %N1% = %N1% - %N2%
    Variable Modify String: Delete Part of %T1%
    Replace " " with "" in %T1%
    If File Exists "testforgogi.csv"
     Variable Modify String: Append %T1% to Text File
    Else
     Variable Modify String: Save %T1% to Text File
     Copy File or Files: "testforgogi.txt"
    End If
    Variable Set Integer %N1% to 1
    ASCII File Begin Process: "testforgogi.csv" (Comma Delimited Text )
     Variable Modify Integer: Inc (%N1%)
    ASCII File End Process
    ASCII File Begin Process: "testforgogi.csv" (Comma Delimited Text )
    ASCII File End Process
    Delete File or Files: "testforgogi.txt"
    Text Box Display: Results

     

    <TVAR2:01:01:Parker, Fred & Parker, Joan><IVAR2:01:12:1><NMVAR:01:01:1:0000001:2:0000001><IVAR2:02:13:1:&><NMVAR:02:01:1:0000001:1:0000002><TMVAR2:11:01:00:N02:N01:><TMVAR2:21:01:01:000:000: ><IFOTH:01:2:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.csv><TMVAR2:20:01:00:000:000:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.csvT><ELSE><TMVAR2:17:01:00:000:000:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.txtT><DOFILE:05:NN:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.txt>C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.csv><ENDIF><IVAR2:01:01:1><ADFBEG:F10:001:000001:000000:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.csv><NMVAR:08:01:0:0000001:0:0000000><ADFEND><ADFBEG:F10:001:N00001:000001:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.csv><ADFEND><DOFILE:08:NN:C:\Users\Steven\Documents\Macros\Macro Test Files\testforgogi.txt>><TBOX4:T:1:CenterCenter000278000200:000:ResultsFirst name: "%T2%"
    Last name: "%T1%">

  19. I often create HTML files in ME3 and launch the files with no borders, toolbars and all that. You can even create usefull

    links and active contents like forms that do things if you're HTML inclined.

     

    Can you give an idea how you do that? I mean, I can write a text document and save it as HTML, but if I launch it, it

    just opens a normal browser window with the text inside. How do you lose the borders, toolbar, etc.?

  20. Ahhh, thanks Terry,

     

    Right now, if I have a bunch of photos pulled up in their original state in my photo editor, I have a macro that I run that resizes

    them to fit more sensibly in emails or for uploading to my blog, then it changes the name (adding a "smaller - " to distinguish it

    from the original), and saves it in a different folder (keeping my "smallers" separate from the originals), closes that picture and

    then moves on to the next photo.

     

    So, if I am understanding correctly, I could use this macro and change the guts of ContextMacro to essentially do what I was

    doing with the previous macro, but just one pic at a time. Or, obviously, I could expand the macro to do a variety of tasks. It's

    essentially a really useful way to capture a path and add it to %T1%

     

    Ok, the gears are turning now. Very helpful suggestions, thanks again!

  21. Thanks rberq!

     

    This is great info. I'll have to look into .bat files (the majority of my programming experience is with ME, HTML, and some

    BASIC a very long time ago - I know, I'm Jurassic).

     

    The above has an obvious drawback, in that any macros the users themselves develop will have to be in the master .mex,

    or they will be overlaid by the next copy. It will require central management and coordination to make this work. I don't

    have that problem because my users will not be developing their own macros.

     

    Nobody at my current place of employment has any desire to write macros. Everybody has the Editor on their system, but

    the only time the editor has ever been opened is when I've gone over to import macros, so overwriting isn't likely to be an

    issue.

     

    I do wonder, however, about that. At my last job, everybody was able to write their own macros, but we also had department

    wide macros that were updated automatically whenever we restarted ME. My macros were part of my macro file, and yet so

    were the department-wide macros. Mine never got wiped out with an update.

     

    Did I misunderstand what you said, or is there another way to have system-wide macros work alongside personalized macros?

    It's been a couple of years since I left that job, but I seem to remember that their macros were not coded macros... I think they

    were "Macro Run" commands (I didn't really know anything about Macro Run back then - my macs were usually pretty basic

    window manipulations and Text Types), or something else from the Macro Control category (I do remember the icon). It may

    have been the Load Macro Text file... in fact I think it was the Load Macro Text file command.

     

    This command is one that I have never used, or played with, so I'm going to start right away, to see what it does. I'll get out

    my trusty ME Explained and see if I can grasp its uses. If you, or anybody else reading the thread, knows how this command

    could be used to accomplish what I've described above (assuming it's different from the .bat solution), I'd be happy to hear

    about it.

     

    Thanks!

  22. I have a half-satisfactory solution. I store a "master"' macro file on a network drive, and I can update that whenever I want. Each user has his own macro file on his C: drive, which is refreshed from the "master" by a simple copy-file prior to ME startup when the PC is rebooted. (I also start ME in the batch file that does the file-copy.)

     

    So far I haven't had to update macros mid-day, but if that becomes necessary I will give users an icon to a batch file that ends ME, refreshes the macro file, and restarts ME.

     

    rberq,

     

    At a company where I used to work, we had a set-up very similar to this and it worked fantastically. Unfortunately, I was just one of the peons who had ME on my drive, and wasn't one of the official macro creators (though we all were encouraged to write macros and share the ones we found most useful with our co-workers).

     

    Now, however, I work somewhere else and just under a year ago they finally got their act together and got us Macro Express. I am the only person in the department (possibly the company) who has any familiarity with ME, and so I set to work building macros like crazy to make my job less annoyingly redundant. I want to set up a system much like the one we had at my previous employer, such as the one you described above, but I was never in the loop on how to do that, and would love some clarification about just how I would go about making a "copy-file prior to ME startup". As it is, very few of my co-workers use more than about 5 macros, whereas I'm using upwards of 40 or 50 (many of which are called from other macros) to keep my day cruising along without too much boredom-induced trauma.

     

    Any pointers would be super!

  23. Ok, this is cool, and I got it set up first try.

     

    Just one question... and it's probably a noob question at that.

     

    What is the practical use for this? Just an idea (so I can get the gears turning in my head) of how it could benefit me and the work I do with macros.

     

    Thanks! :)

  24. I use MX 3.7d with Vista, though like Terry my default browser is Firefox. I tried Scasper's troublesome macro and had exactly the same result as Scasper: 2 instances of IE7, one running minimized showing 'connecting' all the time, the other running maximized showing the university login page. I'm not able to offer any help I'm afraid but I thought it worth reporting as it appears to add further support to it being Vista/IE7 related.

     

    P

     

    Awesome, thanks Pepperpod. If I'm not the only one with this problem, then there may actually be something that

    Insight can fix (assuming Kevin and Stan don't have a fix for us). I'll just stick with the commands that work for now.

    It's not a huge issue, as long as I use 'Default' and run 'Wait for Web Page' as a separate command.

     

    Frankly, I switched back to IE from Opera and Firefox since Opera won't work with a lot of sites I use, and I wanted

    to be able to use ME with my browser.

     

    I am glad I'm not just running a broken system over here!

  25. I wanted to think it had something to do with IE, and maybe it does on some level, but I've just tested it out using the

    following browsers (with versions) set as my default with the following code:

     

    IE: 7.0.6001.1800

    Firefox: 3.0.3

    Opera: 9.61

    Google Chrome: 0.2.149.30

     

    Web Site: http://uvlink.uvu.edu/cp/home/loginf [Default Browser]

    Wait for Web Page: "http://uvlink.uvu.edu/cp/home/loginf"

     

    With the exception of Opera, in which I launched http://www.google.com since UVLink doesn't like Opera.

    And:

    I only used the Wait for Web Page command when launching IE.

     

    All browsers launched the page in question without any problems. If an instance of the browser was already open, the

    new URL launched in a separate tab within that instance. This includes IE, which is strange because last night IE wasn't

    launching at all when set as the default browser.

     

    However, as soon as I set the macro command to launch IE (specifically, rather than through the Default Browser option),

    the macro started launching two instances of IE, one that never fully loads, and just hangs in the background preventing

    the Wait for Webpage command from completing (this is only true of the check box in the Web Site Command; when using

    the separate Wait for Web Page command, the second window is still hanging in the background, but the macro recognizes

    the one that loads and the macro completes).

     

    Furthermore, if I have an instance of IE running, the macro launches a new IE window, opens the URL I'm looking for in a

    new tab of the original IE browser, and then continues to hang, if the check box is selected. If not, it opens the hanging

    window, launches in a new tab in the original browser, and then stops running once the web page has loaded (when using

    the separate "wait for" command).

     

    I've tested this using a shortkey, a hotkey and using the play button on the macro script window with identical results each

    time.

     

    I don't know if this is technically a bug in the Web Site command, or if it is just a miscommunication with this version of IE,

    but it is kind of frustrating if the latest version of ME can't communicate effectively with the only browser that it is supposedly

    compatible with.

     

    I run similar macros from my work computer which is still on IE 6, and never have any problems... so this is likely due to

    something in IE 7, but I can't even begin to guess where that problem is, or what adjustments I might need to make to IE in

    order to fix it. I'm not planning to roll back my IE or even my ME just for this one problem, since there are workable - yet

    annoying - work-around solutions.

     

    I did a search for similar issues and found one last night, but after Kevin asked the poster for his ME version, the poster never

    responded. That was back in April. I'll try to find it again and post a link in an Edit to this message.

     

    -EDIT 1- I just tried it out on my wife's computer without any difficulty whatsoever. She's running the same ME version as me,

    and virtually the same IE, though her IE version is: 7.0.5730.11 I can't imagine there being that much difference between the

    two versions. Her computer is running WinXP SP3. I'm running Vista Ultimate 32 SP1. Maybe it's a Vista issue?

     

     

    -EDIT 2- Ok, well I can't figure out how to link to the post I referred to above, so I'll just give the information about it, and if

    somebody with more brains and know-how wants to look it up, that would be great.

     

    Posted by: Billy.Quick

    Date Posted: April 14, 2008

    Post Title: Possible Bug Report ?

     

    His exact post is:

    Recently, a function that used to work in a Macro I wrote stopped working. I suspect something about Internet Explorer has changed.

     

    The Command: "Internet>Web Site: https:// (etc...)" launches one instance of Internet Explorer, but two different tabs. The first tab is launched without a web-address, and cycles indefinately per the "wait for web-page to load" tick, and the second tab loads the URL correctly, but the script will not move forward due to the hanging first IE tab.

     

    This happens whether "Default Browser" or "IE" is checked.

     

    I'm developing a work-around by trying to launch a specific instance of IE with the URL as secondary, but getting the "wait for" to work is a bit hairy for me.

     

    I'm using IE 7 and Vista Ultimate, if this matters.

     

    Any help or explanation appreciated.

     

    Billy

     

    After which Kevin requested his ME version. No further reply.

×
×
  • Create New...