Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by stevecasper

  1. Here's My workaround. Wish I didn't need it. I worry that the "close" command will close the wrong one. After a half-dozen tests it has only closed the one that isn't loading. So far, so good. Web Site: [url="http://uvlink.uvu.edu/cp/home/loginf"]http://uvlink.uvu.edu/cp/home/loginf[/url] [internet Explorer] If Window Title "Windows Internet Explorer" is running Window Close: "Windows Internet Explorer" End If Wait for Web Page: "http://uvlink.uvu.edu/cp/home/loginf" Activate Window: "Utah Valley University Login -" <HTTP2:2:F:http://uvlink.uvu.edu/cp/home/loginf><IFOTH:04:1:Windows Internet Explorer><WCLS:Windows Internet Explorer><ENDIF><WAITWEB2:000010:000000:http://uvlink.uvu.edu/cp/home/loginf><ACTIVATE2:Utah Valley University Login ->
  2. I know you asked Kevin, but since I just happen to be monitoring the board right now (got a problem of my own), I thought I'd answer. When you are running the macro with the script editor open, the title of the macro is in the title bar of macro express. So when you run the macro with only "Activate Window: "notepad", the macro sees that "notepad" is the top window and doesn't bother doing anything. I don't want to upset anybody by continuing my problem in this thread, when I've got one open, but if you happen to know the answer to my problem and can post it to the other thread (about the Web Site Command), I would be very happy!
  3. Hi, I'm trying to create a macro that will use the Web Site command to launch my University student login page (it's a bore to get to my online classes by hand, but building macros is seldom boring), strangely, though, the command is launching two Internet Explorer browsers. The first one launches and never loads anything, the second one launches only fractions of a second later and loads the school page right away, but the macro keeps running, as though the page has not loaded (I am using the Wait for Webpage option, as the macro needs to do more once I'm logged in). I've never had this problem with the Web Site command before. Any ideas why this is happening, what I could look for in my system or settings that may be causing this? Any help would be appreciated, thanks! Specs: IE: 7.0.6001.1800 ME: 3.7d OS: Vista 32 P.S. I've tried launching other websites with the same problem. The Google homepage isn't even recognized when it's loaded, and two browsers are launching. If I turn off the wait for webpage option, the macro stops running, but that doesn't fix the two browsers problem. I'm baffled. Hate to have to do it the old-fashioned way: "Program Launch: iexplore.exe, Wait for window title, Alt+D, <TEXTTYPE:URL <ENTER>>, Wait for window title"... Almost defeats the purpose of the macro! By the way, the Program Launch command only launches one instance of IE. So it seems like it's the Web Site command itself. Edit - Something else I tried. My default browser was Opera (running it that way, it works fine... the problem is my university website doesn't trust Opera). I changed my default browser to IE, and ran the macro launching in the default browser, it doesn't even succeed in getting an IE browser open. I'm terribly confused.
  4. Always happy to help whenever I can. I find I'm looking for it myself far more often than I'm able to provide it, unfortunatly. Speaking of which, as I looked through your version of the macro I saw something I hadn't noticed: the Find function ignores the macro currently highlighted (essentially the one you're working on). I hadn't realized that. I had better keep that in mind if I ever need one macro that re-writes another. I actually built a similar macro for my mother-in-law, who hasn't a programming bone in her body, but needs to add new macros on a fairly regular basis. I can't always be there to write them for her, so I built a macro that creates a new macro for her using information from prompts (the ones she creates are very simple text-type macros with shortkey activations). Fortunately, she doesn't need to edit old macros, so the Find problem isn't an issue. The macro I built for her uses the Mouse click on tray icon, and she hasn't ever had a problem with it. You say yours is working consistently now, so maybe the problem will remain unsolved, but it would be nice to isolate it to take steps to prevent it with confidence. I personally don't know why running a particular macro at an irregular or random schedule would be desirable, but I wonder if it is enough of a need that our friends at Insight want to look into making it an option under the Scheduled option.
  5. I just upgraded my work PC to version 3.7d build 1, 3.7.4.1 and the macro still works. And, as always, Kevin makes good suggestions.
  6. I copied your Direct Editor code into my ME, and it runs fine, doing what it's supposed to, whether I run it from a hotkey, shortkey or the Play button on the Scripting Editor window. I'm running ME version 3.7a build 1, 3.7.1.1 on this computer. My comp at home is running 3.7d, but I can't check that one right now. This may be an issue for the Insight folks.
  7. Hey Terrypin, I haven't checked out your version of the code yet, but my first thought on the erratic success of the Move Mouse to Tray Icon might be related to the tray itself. My first suggestion, assuming you hadn't already done so, would be to right click on the task bar, select properties, access the "Customize" Button, and then make sure Macro Express is set to "Always Show". Of course, if it is already set to Always Show, then this won't fix anything. I'll take a look at your code in a little bit and see if I can't incorporate any of your suggestions into my own personal knowledge base Another option, that might be more consistently useful, would be to simply have the macro launch program, but since the program is already running I'm not sure if that would work. I'll have to look into it (who knows, maybe that's what your code will show me!)
  8. What blopib suggested is probably the best option if you don't need to be running other macros in the mean time. If you do, then your best bet is going to be to set a random integer (based on maximum and minimum number of minutes between macro runs) and then attaching code to the end of your macro that will open the Macro Express Editor, Open the macro you want to edit, change the schedule from the Properties tab of the Editor, and then save it. I don't believe there is any way to change the properties of a macro without opening the Editor (if there is, I definitely want to know about it!). This part of your macro will end up looking something like this: Get Mouse Position Screen: %N1%, %N2% Move Mouse to Tray Icon: "Macro Express" Mouse Left Button Click Mouse Move Screen %N1%, %N2% Variable Set Integer %N1% with a Random Number Wait For Window Title: "Macro Express - Macro Explorer" Text Type: <ALT>mh Wait For Window Title: "Find" Text Type: <NAME OF MACRO HERE> Text Type: <ENTER><ESC><ENTER> Wait For Window Title: "Scripting Editor" Text Type: <SHIFT><TAB><ARROW RIGHT> Repeat Start (Repeat 7 times) Text Type: <TAB> Repeat End Text Type: <ENTER> Wait For Window Title: "Set Schedule" Text Type: <TAB><TAB> Text Type: %N1% Text Type: <TAB><TAB> Text Type: <ENTER> Text Type: <CONTROL>s Restart Macro Express <MOUSEPOS:T:01:02><MOVETOTRAY:Macro ExpressF:F:0:0><LCLK><MMS2:1N,2N><IVAR2:01:06:10><WAITWIN2:000010:000000:Macro Express - Macro Explorer><TEXTTYPE:<ALT>mh><WAITWIN2:000010:000000:Find><TEXTTYPE:<NAME OF MACRO HERE>><TEXTTYPE:<ENTER><ESC><ENTER>><WAITWIN2:000010:000000:Scripting Editor><TEXTTYPE:<SHIFT><TAB><ARROW RIGHT>><REP3:01:000001:000001:00007:0:01:><TEXTTYPE:<TAB>><ENDREP><TEXTTYPE:<ENTER>><WAITWIN2:000010:000000:Set Schedule><TEXTTYPE:<TAB><TAB>><TEXTTYPE:%N1%><TEXTTYPE:<TAB><TAB>><TEXTTYPE:<ENTER>><TEXTTYPE:<CONTROL>s><RESTARTMACEXP:FT>
  9. Hmm, I didn't notice your other post where it looks like you found a way to get the new file names. It was still fun to work on it. I'm not sure about the CPU usage situation. Good luck with that!
  10. Hi Pat, I think I have a solution to your problem. The line where you save %T2% to "All file Names.txt" is where this code needs to be inserted. My code includes this line, so don't forget to remove yours (it's important that the first part of this code occur before T2 gets saved as a text file, and equally important that the rest of it falls afterwards - Or you can just replace your entire code with the Full Macro Code that I put down at the very bottom - I gave just the code I added first in case you wanted to look at it and pick it apart for your own amusement). Once you have done this, you can either write some code to open the "New File Names.txt" file that this code creates at the end of the macro, or plug %T5% into your Text Box Display where the number of new files is displayed. If you have any trouble with this, double-check the paths (I changed them to work on my computer for me as I tested it, and tried to get them all changed back but I might have missed something), otherwise, if there is trouble, let me know and I'll try to help you out! P.S. You may want to consider setting %T2% back to "" before running the "Repeat with Folder" command, as the Value of T2 is getting saved into the All File Names.txt (unless you want it there, of course - I did not make this change in the Full Macro Code). Here's the code.: Direct Editor <IFOTH:01:2:C:\Documents and Settings\Pat\Desktop\Old File Names.txt><TVAR2:05:04:C:\Documents and Settings\Pat\Desktop\Old File Names.txt><ELSE><DOFILE:05:NN:C:\Documents and Settings\Pat\Desktop\All file Names.txt>C:\Documents and Settings\Pat\Desktop\Old File Names.txt><ENDIF><TMVAR2:17:02:00:000:000:C:\Documents and Settings\Pat\Desktop\All file Names.txtF><TVAR2:06:01:%T5%><BTFBEG:004:000001:000000:C:\Documents and Settings\Pat\Desktop\All File Names.txt><TMVAR2:21:05:01:000:000:%T4%><BTFEND><TMVAR2:17:05:00:000:000:C:\Documents and Settings\Pat\Desktop\New File Names.txtF> If File Exists "Old File Names.txt" Variable Set String %T5% from File: "Old File Names.txt" Else Copy File or Files: "All file Names.txt" End If Variable Modify String: Save %T2% to Text File Variable Set String %T6% "%T5%" Text File Begin Process: "All File Names.txt" Replace "%T4%" with "" in %T5% Text File End Process Variable Modify String: Save %T5% to Text File The Full Macro Code <BTFBEG:002:000001:000000:C:\Documents and Settings\Pat\Desktop\Count Total Files in Favorites.txt><TMVAR2:05:02:02:000:000:><BTFEND><IVAR2:01:01:1><ASCIIC:95:1:13><ASCIIC:96:1:10><TVAR2:95:01:%T95%%T96%><REP3:07:000004:000001:0001:0:01:C:\Documents and Settings\Pat\Favorites><NMVAR:08:01:0:0000001:0:0000000><TMVAR2:08:01:95:000:000:><TMVAR2:08:02:01:000:000:><ENDREP><IFOTH:01:2:C:\Documents and Settings\Pat\Desktop\Old File Names.txt><TVAR2:05:04:C:\Documents and Settings\Pat\Desktop\Old File Names.txt><ELSE><DOFILE:05:NN:C:\Documents and Settings\Pat\Desktop\All file Names.txt>C:\Documents and Settings\Pat\Desktop\Old File Names.txt><ENDIF><TMVAR2:17:02:00:000:000:C:\Documents and Settings\Pat\Desktop\All file Names.txtF><TVAR2:06:01:%T5%><BTFBEG:004:000001:000000:C:\Documents and Settings\Pat\Desktop\All File Names.txt><TMVAR2:21:05:01:000:000:%T4%><BTFEND><TMVAR2:17:05:00:000:000:C:\Documents and Settings\Pat\Desktop\New File Names.txtF><NMVAR:05:01:0:0000003:0:0000000><TMVAR2:17:03:00:000:000:C:\Documents and Settings\Pat\Desktop\Count Total Files in Favorites.txtF><NMVAR:02:03:1:0000001:1:0000002><TBOX4:T:1:CenterCenter000278000200:000:Number of Files CopiedThere were %N1% files copiedYou have added %N3% new files since last update><TEXTTYPE:;>
  11. Well, I guess I'm just impatient After much trial and error, and no immediate response, I think I've figured out how to do it. I don't know if it's the most elegant way (though it's better than a lot of my earlier attempts) so if anybody knows or thinks of a better way to do this, please let me know. For anybody who is looking to do the same thing (or something similar), here's what I did: Scripting Editor: Variable Set String %T3% "972" // Here I create a .txt file with my .csv data (the information ends up separated by a comma) If File Exists "TestExcel.csv" Copy File or Files: "TestExcel.csv" End If // The following Process puts Column A into T1 and Column B into T2, line by line. ASCII File Begin Process: "TestExcel.csv" (Comma Delimited Text ) If Variable %T1% = variable %T3% Break End If ASCII File End Process If Variable %T1% <> variable %T3% Variable Set String %T4% "" Variable Set String %T4% from Prompt Variable Set String %T2% "%T4%" Variable Modify String: Append ",%T4%" to %T3% Variable Modify String: Append %T4% to Text File // Here I replace my .csv file with the .txt file where I just appended the new info. Copy File or Files: "TestExcel.txt" End If Direct Editor: <TVAR2:03:01:972><REM2:Here I create a .txt file with my .csv data (the information ends up separated by a comma)><IFOTH:01:2:C:\TestExcel.csv><DOFILE:05:NN:C:\TestExcel.csv>C:\TestExcel.txt><ENDIF><REM2:The following Process puts Column A into T1 and Column B into T2, line by line.><ADFBEG:F10:001:000001:000000:C:\TestExcel.csv><IFVAR2:4:01:1:T3><BREAK><ENDIF><ADFEND><IFVAR2:4:01:2:T3><TVAR2:04:01:><TVAR2:04:02:FWhat is the correct number for Column B?FFCenter:Center><TVAR2:02:01:%T4%><TMVAR2:07:03:00:000:000:,%T4%><TMVAR2:20:04:00:000:000:C:\TestExcel.txtF><REM2:Here I replace my .csv file with the .txt file where I just appended the new info.><DOFILE:05:NN:C:\TestExcel.txt>C:\TestExcel.csv><ENDIF>
  12. Hi, I've searched the boards and tried a few different things I've found, but nothing I've seen does what I'm trying to do. Here's the basic idea: In Excel I have a list of numbers in column A and another list of numbers in column B. I run a macro that searches for the specific number in column A and when it is found, the macro then takes the information on that line from column B. This much works fine. Here's where I have a problem: If there is no match in column A (the number searched for doesn't exist), I get a prompt for what should be in column B (The macro already knows what should be in column A based on the search). Now I want the macro to add the information from my variables to column A and column B. Here's what I have so far: Scripting Editor // For this example, 972 is not in my list yet. I need it to be. // The number needed in Column B is 801 (it is not there yet, either). Variable Set String %T3% "972" // The following Process puts Column A into T1 and Column B into T2, line by line. ASCII File Begin Process: "TestExcel.csv" (Comma Delimited Text ) If Variable %T1% = variable %T3% Break End If ASCII File End Process // If T1 never = T3, then T3 is not yet in my list If Variable %T1% <> variable %T3% Variable Set String %T2% "" Variable Set String %T2% from Prompt // Right here I want to be able to append T3 to Column A and T2 to Column B. // So that next time I search for T3 I won't have to input T2 by hand again. End If Variable Modify String: Append %T3% to %T2% Variable Set String %T3% "%T2%" Text Box Display: T3 Direct Editor Script <REM2:For this example, 972 is not in my list yet. I need it to be.><REM2:The number needed in Column B is 801 (it is not there yet, either).><TVAR2:03:01:972><REM2:The following Process puts Column A into T1 and Column B into T2, line by line.><ADFBEG:F10:001:000001:000000:C:\TestExcel.csv><IFVAR2:4:01:1:T3><BREAK><ENDIF><ADFEND><REM2:If T1 never = T3, then T3 is not yet in my list><IFVAR2:4:01:2:T3><TVAR2:02:01:><TVAR2:02:02:FWhat number goes with %T3%?FFCenter:Center><REM2:Right here I want to be able to append T3 to Column A and T2 to Column B.><REM2:So that next time I search for T3 I won't have to input T2 by hand again.><ENDIF><TMVAR2:08:02:03:000:000:><TVAR2:03:01:%T2%><TBOX4:T:1:CenterCenter000278000200:000:T3%T3%> If more information is needed, or if I've been unclear about anything, please let me know. Thanks!
  13. No, the macro won't run until you've completed the activation (meaning you have to release the keys or buttons pressed which activate the macro before it will run), however there may be another way to accomplish whatever it is you're trying to do. Can you give more detail about why you need to hold the Space Bar down for an unspecified length of time?
  14. I've actually just come up with a slightly more elegant way of merging your two text files. This will save your merged files into a third file as it processes them. It doesn't require any Run Macro in Variable commands, so that makes it somewhat simpler, and it answers the question of "What if I don't know how many lines my a.txt and b.txt files are?" and the even more horrifying: "What? You mean I have to actually type out %T10% - %T29% or more!?!?!?!?!? That's insane!" Without further ado: <CLEARVAR1:T:ALL><TVAR2:01:01:%HOMEDRIVE%%HOMEPATH%\Desktop\a.txt><TVAR2:02:01:%HOMEDRIVE%%HOMEPATH%\Desktop\b.txt><TVAR2:05:01:%HOMEDRIVE%%HOMEPATH%\Desktop\c.txt><IVAR2:01:01:1><IVAR2:04:01:1><IVAR2:02:01:10><IVAR2:03:01:11><BEGCLIP><TEXTTYPE: ><ENDCLIP><TVAR2:06:03:><BTFBEG:003:N00001:000000:%T1%><TMVAR2:08:03:06:000:000:><TMVAR2:20:03:00:000:000:%T5%F><BTFBEG:003:N00004:000001:%T2%><TMVAR2:08:03:06:000:000:><TMVAR2:20:03:00:000:000:%T5%F><NMVAR:01:04:1:0000004:2:0000001><BTFEND><NMVAR:01:01:1:0000001:2:0000001><BTFEND><LAUNCHDEL2:0:01C:\Documents and Settings\Steve's Main\Desktop\c.txt>
  15. This can indeed be done with Macro Express. You will need to use a Run Macro in Variable expression in order to keep the macro to a reasonable length. If you aren't already somewhat familiar with how Run Macro in Variable works, I highly recommend learning about it. It's made a huge difference in the versatility of my own macros. But I won't make you learn about it right now. Here is the code I would use to do what you need (below the code I have detailed exactly what this macro does so that if you wanted to break it down in order to understand what exactly is going on for use in other macros, you can. If you don't really care about why or how it works, you can just skip it and jump down to the Direct Editor text at the bottom of my post): <CLEARVAR1:T:ALL><TVAR2:01:01:%HOMEDRIVE%%HOMEPATH%\Desktop\a.txt><TVAR2:02:01:%HOMEDRIVE%%HOMEPATH%\Desktop\b.txt><IVAR2:01:01:1><IVAR2:02:01:10><IVAR2:03:01:11><BTFBEG:003:000001:000000:%T1%><TVAR2:04:01:<TVAR2:%N2%:01:%T3%\s>><RUNMACVAR:4><NMVAR:01:02:1:0000002:2:0000002><BTFEND><BTFBEG:003:000001:000000:%T2%><TVAR2:04:01:<TVAR2:%N3%:01:%T3%\s>><RUNMACVAR:4><NMVAR:01:03:1:0000003:2:0000002><BTFEND><TBOX4:T:1:Center000317000278000373:000:LIST%T10% %T11% %T12% %T13% %T14% %T15% %T16% %T17% %T18% %T19% %T20% %T21% %T22% %T23% %T24% %T25% %T26% %T27% %T28% %T29%>
  16. I know I'm two months late with my post, so you've probably worked out a solution. But here's my version of how to do what it is I believe you're trying to do: <IVAR2:01:01:0><REP3:08:000002:000001:0001:1:01:T1><REM2:Enter Your Code Here><NMVAR:01:01:1:0000001:2:0000001><ENDREP><TBOX4:T:1:CenterCenter000278000200:000:%N1% = number of times the macro repeatedThis repeated %N1% times.>
  17. Ok, I think I got it. So often I see posts where the person in need figures out their problem but fails to post what it was that they did to fix it... well I want to see what I can to do help anybody else who's having the same problem as me. Here's the updated code: <BTFBEG:004:N00003:000000:%T2%><IVAR2:01:13:4::><NMVAR:01:01:1:0000001:2:0000001><TMVAR2:11:04:00:001:N01:><TMVAR2:01:04:00:000:000:><IFVAR2:1:04:2:><IVAR2:01:12:4><NMVAR:01:01:1:0000001:2:0000001><TMVAR2:15:04:00:%N1%:000:><TVAR2:05:01:<TVAR2:%N4%:01:%T4%\s>><RUNMACVAR:5><NMVAR:08:04:0:0000001:0:0000000><ENDIF><BTFEND>
  18. Hi, I've been using this forum off and on for several weeks though this is the first I've posted. I've been using Macro Express at work for between 4-5 years now, and just a few weeks ago I purchased a license for at home (I've become somewhat addicted to ME). Right now I'm attempting to develop a process for work that will help me collect, save, and retrieve information. So far I've got a working set-up, but it's unbearably long. Here's the basic gist: I run Macro#1 which, through prompts and various screen-scraping, collects a series of information. The end of the macro pastes all the information into a word document, which I then have to print out for hard-copy record-keeping. Macro #2 (which I will eventually just append to the end of Macro #1), saves the text of the word document to a text-file titled from one of the prompts of Macro #1. Macro #3 is the bear. This macro finds the text-file, then processes line by line the information on it. Since I only need the information which falls after the colon on each line, getting the important information from each line isn't a problem at all. The problem is in the unmanageable length of the macro itself. I built a test macro using my first, middle, and last names; my wife's names, our baby's first and middle names and the month and year of her birth. It works fine, but it's only 10 lines of processed text, and yet the macro itself is insanely long and is going to be an immensely overwhelming task to convert for work (which is going to need at least twice as many processes). Here's the part of the macro that I'm trying to make more manageable: <BTFBEG:004:N00003:000001:%T2%><NMVAR:08:03:0:0000001:0:0000000><NMVAR:08:03:0:0000001:0:0000000><IVAR2:01:13:4::><IVAR2:02:12:4><NMVAR:01:01:1:0000001:2:0000001><TMVAR2:11:04:00:001:N01:><TMVAR2:10:04:04:001:N02:><TMVAR2:01:04:00:000:000:><IVAR2:01:12:4><NMVAR:01:01:1:0000001:2:0000001><TMVAR2:15:04:00:%N1%:000:><BTFEND>[/
×
×
  • Create New...