Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. If I remember correctly when I went to IE7 in XP ME failed to run from hotkeys. The solution, I was told, was to disable Protected Mode. But I was just checking something regarding PM on another post and realized that since I went to Vista I don’t remember ever disabling PM and ME has been working fine. Recently I disabled PM for Local Intranet and Trusted Sites zones but I don’t think that had anything to do with it. Just now I enabled PM for all zones and have tested several macros and all seem to be working fine. So what exactly is the scope of the PM problem? Was it only for IE7 running XP? Is it possible that Vista is immune? I don't care as there is no problem for me but I thought other's might be interested to know that one can use PM and ME but I'd like to understand it better before making that declaration. Oh, also I just FnR’d a new laptop for a client with a fresh install of Vista Business and have not changed any of the default settings other than to apply all the updates, install Office and other user apps. ME works fine.
  2. I created a simple macro Window Hide: "Untitled - Notepad" and it worked in both Vista Ultimate with no Aero and Vista Business with Aero. The Ultimate system has Live OneCare and the Business system is running McAfee VirusScan Enterprise. The Ultimate has Protected Mode enabled for all except trusted sites and Business has Protected Mode active in all zones. I also create a recentering macro and it work in each. Sorry I couldn’t be of more help but at least now you know that the problem isn’t Vista but rather some configuration or third party software and therefore rectifiable. Are you running any anti-spyware? How about any of those security suites with “Privacy Protection” or other similar apps that might be monitoring you input activities? Have you swept for spyware and viruses? Maybe you have a keystroke logger active. I could imagine how one of them might interrupt your macro. My guess is that you have some security software that’s interrupting your input thinking you have a bug and worried about ME’s activities. Beyond that I have no clue. As an admin my next step would be to isolate the problem by disabling different things. Maybe try a Safe Mode boot.
  3. I have been using ME for years and I know of no such capability. But Floyd wrote a cool HTA example for putting multiple inputs into a form that one could make any way they like. Click here for his post and example.
  4. If you post your code I could try it in Vista and see if I have the same problem. Also what are the window titles and is it possible they're the same? Maybe it's a new hotkey. I mean what if one of the activation keys is now used by somethign in Vista that wasn't in use in XP.
  5. Look into using Windows Controls instead. I can't tell exactly what you are doing based on the description but in cases like these you're better off this way. You can use them for timing, triggering and all kinds of things. There is a good example in the tutorials page on macros.com using the Windows calculator. I am willing to bet once you see how it works all your problems will go away.
  6. Add a condition If N1<>0 (not equal to zero) for each of the extractions. If the ( is not found it N1 will eqaul zero and you know to skip it. You can also do some smarter logic as well to look for your phone numbers so you can get the Home in the right spot and such. For instacne you can look at the "h:" for the home number but in the example it is't clea what is consistent that can be used as a positional clue.
  7. Controls are strange and have some limitations. I went round and round on this recently and I think I have a fair understanding but I always have to think these things thru carefully. One important thing to know is that “Get Control” sounds like an inappropriate name but it is actually apt. You see GC seems like you are recording the control handle to a variable but you are not. It’s more like a set of directions on how to locate a control. Look back in the posts here from me and you will find a problem I had with accessing controls from Outlook message windows that had the same title. I think you are having a similar problem. Here's my post on the matter. Look at the last message. The main trouble is that ME caches the control handles and there is no way to flush the cache. It doesn’t bother looking up the new control handle because it already thinks it knows it. This becomes a problem with windows that have the same title. I found a fix in my macro but I’m not sure what the fix would be in your case if you are using it for activation. So I think using the window title would be the way to activate it but have it do a test. But you might still need my fix to get the right control.
  8. Here ya go: <CLIPC><TVAR2:01:03:><REM2:Find the position of the first (><IVAR2:01:13:1:(><REM2:Reduce the number 1 so we don't delete teh first (><NMVAR:09:01:0:0000001:0:0000000><REM2:Delete everythign up to the first (><TMVAR2:11:01:00:001:N01:><REM2:Grab the first phone number><TMVAR2:10:02:01:001:014:><REM2:Delete teh first character "(" so we don't get a 1 next time.><TMVAR2:11:01:00:001:001:><REM2:Do it again for the second number><IVAR2:01:13:1:(><NMVAR:09:01:0:0000001:0:0000000><TMVAR2:11:01:00:001:N01:><TMVAR2:10:03:01:001:014:><TMVAR2:11:01:00:001:001:><REM2:Do it again for the third number><IVAR2:01:13:1:(><NMVAR:09:01:0:0000001:0:0000000><TMVAR2:11:01:00:001:N01:><TMVAR2:10:04:01:001:014:><TBOX4:T:1:CenterCenter000278000200:000:T2= %T2% T3= %T3% T4= %T4% > If you find it mystifying how I got around the carriage returns you might want to check out my web page about using a hex editor as it covers the topic of how data appears as opposed to how the computer stores it. http://bluepointdesign.com/macros/hexedit.htm
  9. Write the clipboard copy to a text variable T4 then parse out your phone numbers. Now if the number of characters is the same you can just grab the text from character number X to Y for all three. However it's more likely to be different each time. In this case I would get the position of the ( and stuff it in N1. Then decrement N1 by 1 and delete characters 1 thru N1. Now copy characters 1 – 14 to T1. Now delete the first character of T4. Now do the routine again for T2 and T3.
  10. Did you know you can make feature requests at Insight's website under the support section?
  11. The window title is the window title and if they are exactly the same there's no way to discriminate. You should be able to use the control activation. Are you using control text or index method. I could see that if it’s the index it might be seeing the same control because they both have the same window title. Try doing you “Get control using text” instead. What this does is drill down by looking at the text label instead of the index number. If that doesn't work (but it should) you could set the control text to a var and have an If that would abort the macro unless it's the one you want.
  12. By adding another If condition for .DOC, .XLS, and so on you can have it run a different command line for each file type since their command line switches need to be different. I was just looking at Word and there isn’t a command line switch for printing. It appears that it uses DDE and I’m not sure how to make that work. But you can call a Word macro from the command prompt so you could do something like this example IO found on some guy’s web page. Sub PrintNow() Documents.Open FileName:="D:\_temp\test.doc" Application.PrintOut FileName:="D:\_temp\test.doc" Application.OnTime Now + TimeValue("00:00:05"), "Quit_Word" End Sub Sub Quit_Word() Application.Quit End Sub But then again it might be easier to have ME do it. I know one can print a Word doc by right clicking on it and I see all the DDE stuff in there but I don’t know how one can use DDE from ME. I’m sure there’s a VB Script that one could use instead but it would take a little research to find. Might be a subject for a new post. There are a few guys here that are pretty keen on VB Script that I’m sure could help. I’d love to see a solution as I am sure I will need it one day but I just don’t have the time to research it now. Sorry.
  13. Wikipedia page on batch files Batch files are simple text files that run commands one would normally type into a command (DOS) prompt. If you don't know what this is we might be getting in a little deep for you. But if you want to learn how to do batch commands it might be worth your while to learn. Do you have any experience with command (DOS) prompts? You know, that little back window that pops up when you go Start > Run and type in “command”? Well if not there is bunches of stuff you can do in a command prompt like copying files and such. For instance you could type in “copy myfile.txt a:” and it would copy the file to your floppy drive. If you know a little about this then batch files shouldn’t be too difficult for you. With that PDF file we could type that command from my web page into the command prompt and your PDF would print. And if we create a batch file with several lines of these they would all print consecutively. And you wouldn’t have to use them just for PDF’s, it could be for all file types. So what one would do is create the batch file using the Variable Modify Append to Text File command (with CRLF) and the run the batch file. Then of course you would need to delete the file.
  14. I updated my web page for printing PDF. It's good to get that done. In trying stuff for your post I began to remember allthe problems I ran into and realised the need to record them all someplace. http://bluepointdesign.com/macros/PDFPrint.htm Here's the code that I meant to paste in last time. I checked it to make sure it worked this time! <TVAR2:02:10:What folder do you want to print? ><REP3:07:000002:000001:0001:0:01:%T2%><VFFILE:1:F:1:F:1:F:1:T:3:%T1%><IFVAR2:1:03:1:T.pdf><LAUNCHDEL2:0:01Acrobat.exe<PARAM>/t "%T1%" "printer name"><ENDIF><ENDREP> Check out on my web page about using a batch file instead of the Launch Program command to avoid the flow control issues.
  15. Dang, I pasted in the same thing again! Sloppy, sloppy. I'll try once again... But in the mean time check out what Kevin was saying. Almost all data files are in some proprietary format and with rare exception the printer does not understand this format. When an application prints it creates a file in a format the printer understands. For instance a word doc is in Word's format. If you copied it to a printer you would get digital guacamole. Word converts just the graphics you want to a file in a format dictated by the driver. For instance HP's PCL (Printer Control Language). Think of it this way... You can have a color photo and print it in BW, right? Well the data is much different between the two printer files because you choose a different output configuration but the source file is the same, isn’t it? Back when I worked in Engineering Documentation and before the advent of formats like PDF we actually saved the plot files in HPGL so one didn't require AutoCAD to get a drawing. Then we had clever little programs to copy the files to printer ports for the buyers when they requested them. So you need to run the application in order to generate this printer file. About the only file type that doesn’t is plain ASCII text files. What the /t does is launch the program quietly (minimized) and not prompt the user for print settings. There may be some way to get it to launch without blipping in the taskbar but that’s beyond me. But in my experience it’s a non-issue. I was just trying a couple of things and found one of the stupid little problems. Actually there are a couple. I’ll be updating my web page for these. One problem is that if Acrobat is not open the document remains open. I remember now I had it launch Acrobat first then fire away. Strange behavior. Oh, you don’t need to specify the entire path to Acrobat. I was using simple “acrobat.exe” with not problem. I’ll get back to you in a second.
  16. My example with the different conditons for different text types went all haywire. I just tried pasting it back in and it's broken in the first "If". Try using this one instead: <TVAR2:02:10:What folder do you want to print? ><REP3:07:000002:000001:0001:0:01:%T2%><VFFILE:1:F:1:F:1:F:1:T:3:%T1%><IFVAR2:1:03:1:T .pdf ><LAUNCHDEL2:0:01"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"<PARAM>/p /h "%T1%"3 ><ENDIF><IFVAR2:1:03:1:T .doc ><LAUNCHDEL2:0:01"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE"<PARAM>/p "%T1%"3 ><ENDIF><ENDREP> I just have the one for PDF and it it works fine. You can add more Ifs for other document types.
  17. Whoa, no wonder. I had that all screwed up. Like I said I didn't try it, I was only trying to give you an idea of the structure. Try this: <TVAR2:02:10:What folder do you want to print? ><REP3:07:000002:000001:0001:0:01:%T2%><LAUNCHDEL2:0:01"C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"<PARAM>/t "%T1%" "hp officejet g series"><ENDREP> In my example I had the command line parameters from Word mixed in with the PDF. In this example I don't check if it's a PDF so make a test folder with only PDFs to test. Your path to Acrobat obviously works so I used it in the example. IOW you don't need ot fix it. On my XP machine I discovered that the job did not go to my default printer as I told you. That was based on a Windows 2000 Pro machine. In fact I have no idea where it went! Might ahve to look into that. So I had to explicitly state the printer name and you will ned to modify where it says "hp officejet g series". Go to your printers folder and copy the name exactly as it appears there. This could be a problem if the macro is distributed to several machines so I'll have to check into this one day.
  18. Click here to see my web page wit the Adobe Acrobat silent command line printing trick.
  19. Plain English is a second language for me so forgive me if it doesn’t come naturally. I’m not sure what order this is. Do you have some sort of rule? For the moment let’s assume you just need to print them all in alphabetical order. We can add more logic later if necessary. Let’s say they were just PDF files for the moment. I would do a “Repeat with folder”. This is a simple looping procedure what will return every file name in our folder in alphabetical order to a variable. Now use that file name to create a print command. It might look like this: Repeat with Folder Program Launch: "Acrobat.exe"" Repeat End <REP3:07:000002:000001:0001:0:01:c:\clients\smith\><LAUNCHDEL2:0:01"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"<PARAM>/p /h "%T1%"3 ><ENDREP> You can copy the above and paste it directly into the ME scripting editor. Simple eh? But you want to specify the folder yourself? OK, then add a prompt for folder name. <TVAR2:02:10:What folder do you want to print? ><REP3:07:000002:000001:0001:0:01:%T2%><LAUNCHDEL2:0:01"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"<PARAM>/p /h "%T1%"3 ><ENDREP> Check out our post on getting the folder name by using the right click option too. But you have multiple file types? Well then just add a condition test. Variable Set String %T2% from Folder Name Repeat with Folder Variable Set From File Path If Variable %T3% = ".pdf" Program Launch: "Acrobat.exe"" End If If Variable %T3% = ".doc" Program Launch: "WINWORD.EXE"" End If Repeat End <TVAR2:02:10:What folder do you want to print? ><REP3:07:000002:000001:0001:0:01:%T2%><VFFILE:1:F:1:F:1:F:1:T:3:%T1%><IFVAR2:1:03:1:T .pdf ><LAUNCHDEL2:0:01"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"<PARAM>/p /h "%T1%"3 ><ENDIF><IFVAR2:1:03:1:T .doc ><LAUNCHDEL2:0:01"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE"<PARAM>/p "%T1%"3 ><ENDIF><ENDREP> I don’t know what the command line switches are for Word so I just took a guess at it. You need to research that yourself. Anyway you can see here that we did the Varible Set From Path to set T3 to the file extension. IOW an acrobat file will be “.pdf”. Then if T3 is a “.pdf” it uses that command line. See how this works? I didn’t actually test this macro and I’m sure the “Program Launch” parts will need to be fixed but this should give you a basic idea. Play with that and get you command line switches (parameters) working in ME and then we can go from there.
  20. You can only run one instance of ME on a machine. I have never used ME for load testing but I have written several macros that worked together on several machines over a network. I once needed to download 30k+ messages off a Yahoo group before it shut down once and had as many as 6 machines hammering away at it in parallel to make the deadline. I imagine you can run multiple instance of the software on one machine, right? Well you could have one macro running that would quickly hop between multiple instances of your application mimicking user activity. And this would avoid a licensing violation.
  21. I’ll look up that info here when I get a chance on how to do PDFs. Hmmm… might be another write up for my web page… But if you don’t need to specify a different printer other than your default the command I gave you will work. Here’s the trick: In ME the “Launch Only” command will work just like the “Run” line above your start button. Assuming you’re still on XP. Experiment with that and once you got it down in there use that ‘run’ command in the Launch command. Then substitute variables where need be. Super simple. Of course, this is what I described. In Windows right click the file and choose “Print”. Now strictly speaking it does run the program but it usually does it in some minimized or hidden way. And it will only print to the default system printer. Although I advocate ME for most everything (Still can’t get it to make coffee yet) you might want to consider using a macro in the Db app. If it’s access you can write macros (VBA) that can do a lot of this sort of thing. For instance I am creating a button in my Access Db that will launch an explorer window in the client’s folder. It takes the name and ID can applies some substitution rules and launches the folder. However you may be more comfortable using ME if you want to do things like repeating and such. I know I am a complete newb on VBA so I’m relying heavily on others for that.
  22. There is no GOTO command. But in my experiance of using a lot of logic and programming in ME I have never found it a problem. THere is always a way to structure conditons and repeats to avoid this shortcoming.
  23. Thanks. Let me tell you I was a very happy camper the day I discovered that one. It's nice when working in Excel to be able to massage a bunch of cells in place for the user without haivng to go cell by cell. I have one that reformats social security numbers and one can have hundreds highlighted and it's done in a blink. In fact the users often don't even realize it's done anything!
  24. Cory

    Randomize..

    That's a curious use! Simply create a master macro to run every hour and generate a random number not more than 10 like I suggested and stuff it in N1. Then repeat with folder N1 times sticking the macro name in T1. When the repeat is done T1 will be your random macro name. Just launch it! BTW it might he easier if you keep all those macros in one ME file.
  25. Cory

    Randomize..

    Huh? I'm sorry, it's not clear to me what you are trying to ask. What do you mean by "random run a macro". I was thinking you meant at a random time interval but then you said "every hour". Exactly what is it you want to randomize? Be more explicit please. In general the major way to randomize something in ME is to use the Set Integer Variables using the Set Random Value option. This will give you a random integer but often you need something else. Let’s say you have a list of names you want to pick at random… Simply do a repeat loop thru that list and have it bail out at the random integer value. I don’t know if this is what you are after but thought I would toss it out there anyway.
×
×
  • Create New...