Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. I think Kevo thinks you are trying to print a report or something that is in a Db without opening the Db but I think you’re talking about printing a file from a Db form. For instance there maybe a text file somewhere on the file system and you want to use a macro to grab some info from the form or table and print that file, am I right? If it is the case there are many applications that can print from a command line but not all. If they are simple text files you can simply copy them to a printer port in most cases. But most applications will require a command with a switch. For instance I have a client with hundreds of thousands of PDF (Adobe Acrobat) files and I often need to print thousands at a time for a mailer. Most applications are easy and have something like a “/p” switch where you specify the EXE, switch, then file name you want printed. But some like PDF are more tricky. I spent an entire afternoon one day but finally came up with a reliable way to print PDFs from a “Launch Program Only” command in ME. If it’s PDF you’re after let me know and I’ll hook you up with it. For other applications check out the programs documentation or look online. But here’s a cool trick. Look at the file associations in the system for the extension you’re looking at. You know, open an explorer window, Tools>Folder Options>File Types and find your extension. Once you find it hit the advanced button. Usually there will be a default “Open” action for when you double click the file but there will often be alternate right click options like “Print”. For instance in my system I have PDF print: "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe" /p /h "%1" The %1 will be the file name and you can see the switches are /p for print and /h for “hidden”. Simply steal this and pop in your own variables. In my case this wasn’t enough because I needed to be able to specify a non-default printer but that’s just more command line code. But I think you get the idea.
  2. If you deal much with Excel I can tell you another trick… Don’t type, paste. Check this out… When you copy to the clipboard from Access, Excel, Outlook and dozens of other programs and read it into a text variable or paste it into a text file it’s a tab separated values file! And in Access and Outlook it even grabs the header for you if you have a single record selected. I use this all the time and simply chew thru the text var to get what I need and it works great. On the output side you can paste into cells as well. For instance you can assemble a row or rows of cells in a text variable using the TAB and CRLF and when you paste them in they’re all in order. Saves tons on timing issues. That combined with F5 makes working with Excel a breeze.
  3. I would be willing to lend a hand for hire or even give bits of advice for free here. Contact me offline if you want ot hook up.
  4. You're agreeing with my methods being sleazy? I guess I would have to agree with you.<g> But maybe this will help redeem... Hey, I just thought of another idea for you. Pop up a text box with verbose descriptions and discussion of the options and leave it up. Put it in the upper left maybe. Then pop up your multiple choice box right next to it with the succint options. When they choose close the text box! I'm going to have to remember this one for myself!
  5. There's probably a smarter way to do it though. I know I have an online photo album software that creates web pages of indexed photos for my websiet and it grabs all the size and other attributes to display in HTML text with the photos. I just thougth I would put in my 2 cents worth. http://jalbum.net/
  6. Oh, how cool. Learn something new everyday! TsunamiZ: My suggestion would work by mapping some unused key like F12 to one of your number keys and use that to launch the macro.
  7. I use a free graphics program IrfanView. With it you could easily use the windows controls to do it. But it would require opening every file which might not work for you. However it is exceedingly fast and there are commands like "Space Bar" to advance to the next graphic that you could use in your macro. Also IrfanView has all kinds of batch features and keyboard driven commands that work great with ME.
  8. I think you could do a sleazy word wrap. Just put the extra chunk from Line A on Line B. Then have either A or B give teh result you want. down below. Not pretty but it would work.
  9. Insight has a program to remap keys called SwapKeys. Maybe you could use somethign like that to in effect use the number keys.
  10. I think the only time a lock will appear is if the macro file is being edited. If you're the only one this shouldn't be happening. Maybe the recorder locks the file too. Are you sure it's finished? Try closing ME out and reopening it. If that doesn't work try rebooting. Is the macro file on a file server? Some of my users running Windows 2000 have been having problems with the Server 2003 doing pre-emtive locks which canonly be cleared by rebooting the server! Just thougth I would toss it out there.
  11. I use ME mostly thru RD (Remote Desktop) to Terminal Servers and I recently had a big one where I was copying and pasting back and forth. I learned a few things but I also found that after some time the clipboard becomes unresponsive on the remote machine and that disconnecting and reconnecting fixes this. So many of the things I thought were complex behaviour was acttually the thing glitching out. Not only that but it often just becomes difficult for some reason. Like it's not hearing your commands from afar but only about 60% of the time. In ME I found the trick on the remote session is to always do a clipboard empty right before a copy and move to text variable. As long as the clip copy command is comming from the remote system it seems to be fine. Also there is a new RD client out now that I'm dieing to try.
  12. There may be a more elegant solution, in fact there usually is, but without being familiar with the program I couldn't tell you. Check out ME's Windows Controls commands and see if you can utilize them. Another thought is if the command prompt always appears in the same spot and you can highlight it with the mouse or keyboard you could have ME do it repetitively until the prompt meets your criteria. Another trick I’ve had with command line apps is to let ME be a slave to it or the script. IOW let the script drive the progress. Let’s say I wanted to upload several files by some FTP client. I could write a script to upload the file then when it’s done fire a macro. The macro could then do some file manipulation like queuing up the next file and then fire the script. You get a kind of back and forth this way and it eliminates all the timing issues. When the file is done uploading it runs the next line in the script and closes. This launches your macro to do something like get the next file name, modify the script file for said file and launch the script and quit. Paul recently opened my eyes to MeProc.exe too which helps in this process, you might want to check it out if you go this way. It’s one of those things where in order to come up with a cool method you have to understand all the ways ME works and your application. Without knowing your app it’s hard to say. Often people will come to me with a request for a macro and when I listen to what they propose I find much simpler way than they suggest by delving into the capabilities of the application itself. After all, this is what ME is all about.
  13. Does it have a command prompt interface? Is the command screen availible as a control? I had one once where I was able to copy the entire contents of the screen to a text var and delete all but the last line. I did this over and over until the last line looked like what I wanted then I could start typing again. BTW lost of apps like these supports scripts. Often the script handler will pause for the program to be ready for the next command. In cases like these it's easier to have ME create teh script file for you and run the script as a means of interface.
  14. I'm not sure what to tell you. If you followed the instructions it should work. Did you get an error or anything? Does a macro run when you do it? IOW do you see the 'running man' in the sytem tray? Break it apart. Try associating it with a simple macro that says "Hi there" and see if that runs. Let me see.... If you didn't have the macro loaded in your file it would tell you, so that can't be it. If it was a problem passing the var you would just get a blank like me. Mabye try altering the command in the registry ot try opening notepad or something simple. If it's not doing anything in ME then somethign must be wrong with your MeProc line. Try taking the string from the registry and running it from the Run line. Beyond that I have no idea. It's hard to remmotely troubleshoot a customer complaint like "It doesn't work". What OS are you running?
  15. Simple. I have several macros that do something like search for results in large text files or directories on a file server that match a string so I need to account for the eventuality of more than 36 entries. Usually what I do it count the number or items returned and then I have a clever little loop-test that gives it to the user in chunks. First off I don’t use text files. I have this aversion disk writes to I pump all my matches into a single accumulating text var separated by something like a tab. So when I start out there may be 60 matches. Then I chew thru that var and count until the var is blank. Each time I write the text to a new string var that I will use in the multiple choice appending each with a CRLF. IF I get to 35 I append a “More…” to the end of it and display it to the user. If they choose more it continues chewing thru the original accumulator var, deleting entries as it goes. It’s pretty easy to do.
  16. Does anyone know of a write-up somewhere that explains how the clipboard works in RD sessions? For instance I might copy something on the remote system and still have something on the local system. How does it know which to use? Usually it seems like there is one shared clipboard but other times it seems to go haywire and I can figure out what it’s thinking. Usually if I disconnect and reconnect all is well again but I’m curious to know how it works.
  17. Sorry, no. Not with out doing some experimentation. Maybe Kevin will know more. I too need to consider this as a whole bunch of my people will be going to IE7 soon and I know I need to consider this but I'll cross that road when I come to it. Good luck. BTW, give IE7's tabbed browsing and other features a chance. I'm sure you will eventually find them very cool. FWIW I tried one just now and it simply creates another tab. And if I have the box checked to activate new tabs it appears on top. How come this won't work for you?
  18. IE7 by default will open a 'popup' from another application or whateever to a new tab. I think this is your trouble, right? In any case there is a new option section under the general tab calld "Tabs" that has all the configurations. I'm not exactly sure what you want to do but all the settigns you need should be in here.
  19. This was what I ihad in mind in the beginning. Instead of Wait for Window do a series of commands that gather and test teh top window name with a little dealy in each. I suppose it shouldn't be too much more difficult. It's just no very elegant. I feel a feature request coming on....
  20. As far as I know there’s no way to activate a macro form the clipboard. I think the best you could hope to do would be to have a macro run with a repeat at whatever interval you please. IOW repeat, get clipboard and test, wait 1 second, repeat. But that would mean the macro would be running all the time and you couldn’t run any more macros. Would the clipping be coming from a certain application? If it would I’m sure we could use a control or window activation to limit it’s run time. IOW when the trading options appear in the XYZ Stock Trading program have it recognize a control and start watching the clipboard. When the window or control disappears abort the macro.
  21. Again I’m being lazy here and asking if anyone has a solution for me before I burn up too many brain cells thinking of a solution. I have several macros that repetitively plow thru thousands of records or files in a program extracting data. ME excels at this. Normally they run pretty smooth but often I have to baby sit them as something like 1 in 100 bomb out for unknown reasons. It’s only been a mild inconvenience and I usually structure my macro so that I can easily restart it from where I left off. But it annoys me and I would like to handle this better. Now the kind of advice I’m looking for is broad in scope and generalized and would focus on how to design the program than technicalities. I have many things like this but I’ll make a simple example. My client uses some government form software and I find a need sometimes to manually extract a bunch of records. Unfortunately the software vendor’s QC is scary and the export facility is broken and they don’t seem to have much interest in fixing it. Now I use timing commands like Wait for Window and Wait for Control but once in a blue moon it fails. The window or control pops right up and for whatever reason ME doesn’t see it. So after 20 seconds of displaying the window or whatever it bombs out. The problem is now the macro is still running and doing nothing. If it errors I would like to be able to do something like send me an SMS message or maybe even close the record and reopen. But the only thing ME will do is display the error box. I’ve thought of a couple of solutions but they’re ugly, add a lot of complexity and usually slow the run tie down a lot. So if anyone has an idea of how better to deal with this I would love to hear it.
  22. You can also use the "Launch Program" and use the 2000/XP/Vista shutdown switches. It's just like typing it in at the Run line. For instance shutdown /r /t 30 BTW in Vista there are more command line parameters for Shutdown and you can even add comments now like in Windows Server 2003.
  23. Sorry Jason, I didn't intend to put down your response. That works too. I hope you didn't take offense, I intended none but I should have choose my words more carefully.
  24. It's way easier than that. Save the text file with carriage returns. IOW multiple lines. Like: Tom Dick Harry Now read that text file into a text variable like T1. Now in the multiple choice menu simply write %T1% on the first line. I know it seem odd but your multiple choice menu will now display all three choices! This way you only need one text variable. In some macros I write I manipulate files or search for text. Each time I find a hit I can simply append an accumulator variable. You just need to add a CRLF (carriage return/line feed) to the end and now it's easy to display to your user for choice!
×
×
  • Create New...