Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by stevecasper

  1. Because I was once ignorant, too.............................. After reading Floyd's trick the first time, and being completely confused about this whole HTA thing, I did some research, too. This is what I found: http://www.microsoft.com/technet/scriptcen.../tutorial1.mspx It seems VERY useful, since it's built into windows. However, like any programming language, you need to learn the required formatting, and VB Script is apparently needed. Since I don't know VB Script, I hit the learning curve at a dead run and broke my nose. I still intend to learn, but between work and school and wife and daughter, I am just sitting at the bottom of the curve staring dreamily uphill.
  2. I've just thought of another Pro...... In Outline Mode you don't have to scroll back up a mile to get to the links back to the forum menu. I prefer the links to the Back Button, so that the threads I've already read get grayed out... I hate going to the same one twice in a row (since I'm too lazy to pay attention to the actual topic header). And another pro: If I know it's a long thread (like this one), and I know specifically what post I want to reply to, I can use Outline Mode to find that post and open it in a hurry. Especially with this new technique of actually posting a relevant first line.
  3. For your clarificated enjoyment. Yes I know I made that word up. When I come to the forum in Standard mode, I can simply Ctrl+End to get to the bottom in one quick go, no need to page down repeatedly (though to be honest, I usually just use my scroll wheel, it's set to "pretty darn sensitive" so it scrolls me all the way down very quickly). The last post or two are the new ones, so I don't have to work to identify them. I've either read them or I haven't. The indication is in their position at the end of the thread. In Outline Mode, it takes considerable more "work" (as I like to call it), to find the "Posted today" (the indication of which are newest in Outline mode) phrases. And if there are several of them, located on different "branches" of the outline, it can be obnoxious to my eyes, not to mention my point-and-clicker. Don't get me wrong, I certainly see the value of Outline Mode. I also see value in Standard. I think they are complementary, or could be if the two were wedded in a third "Sexy Mode."
  4. Giving it a fair chance......... Ok, so I've never really given Outline Mode a fair shot, but with your recommendation I've decided to try it out. For the past few days I've been trying to keep the forum in Outline mode. Here's what I've discovered: Pro: It is extremely useful for keeping track of specific Q. and A. or other train of thought and repartee within the main thread. Con: It's a severe pain in the butt when people don't click the right "reply" button. Con: It's also a huge pain to figure out which posts you have already read, and kind of frustrating when you click on one that you think is new, but it's not, so you have to keep clicking till you find the one that is new. Pro: It is easy enough to switch back to Standard in order to find the most recent posts: AKA, the ones I haven't already read. And then switch back, when I'm done. The first con is only a con in as much as people continue to use the wrong reply button. If everybody were to respect the Reply button, they could happily continue on using Standard, while keeping the Outliners from losing their minds. Likewise, the last pro is only a pro-Outline in the sense that you're not stuck in Outline. At this point I don't think the perceived convenience of Outline outweighs its current level of inconvenience. I am, however, going to stick with it for a while longer. It may continue grow on me. We'll see.
  5. I’ll be honest that I don’t know exactly what it is you’re looking for. However, based on what I think you’re asking, I’ll give you a rough example of a complex If/Then macro. Since most of my more complex macros are work-related, a lot of the built-in information would be unrecognizable to you, and a lot of it would be confidential, so I'm building a completely made up example. Honestly, though, you'll learn a WHOLE lot more by reading the Help files and playing around with the Sample macros came with Macro Express. They're labled samples.mex most likely in your Macro Express folder. There are a lot of them, and they show off a lot of the functionality of Macro Express. Hours of fun and education. Plus, the macro express website has tons of user-made macros free to download. They are extremely useful for learning how to build macros of your own. Some of them may even be perfectly suited for your own needs. You can find them here: http://www.macros.com/share.htm Because of text-wrapping issues on the forum, I won't put the actual code in a codebox, but I will attach the full macro so you can import it. Complex_If_Then.mex
  6. Example macro: I hope this helps. If not, please consider picking the macro apart line by line on your own and playing with different commands to help familiarize yourself with how Macro Express works. The Help files are invaluable for learning the ropes.
  7. As I was thinking about this, I thought of something else you might want to look into. Macro Express can actually generate emails for you and send them out without opening Internet Explorer. You would probably need Outlook installed and set up with your email client (ie. if you use Gmail, have your Gmail client handled by Outlook). This way, Macro Express would simply use Outlook to "invisibly" generate and send the emails. I have personally never used this function of Macro Express (my emails tend to be of a personal nature, and never on a schedule). Though, now that I'm on the subject, I may look into it for some of my work necessities which do require me to send emails, sporadically, but annoyingly, throughout the day.
  8. Rather than using the macro to open IE and go through your bookmarks, I'd recommend using the Macro to open IE directly to your email site (1 command). Example: Web Site: http://mail.google.com [Internet Explorer - Wait to load] You'll still need to build the commands that will sign you into the site. You can de-activate the schedules on the other macros and then use the "Macro Run" command within the 1st macro to run these various other macros. Of course, timing them may take some trial and error, or the use of Date/Time commands together with "If/Then" statements... Depending on your familiarity with ME, it may be easier to simply leave the separate macros on their own schedules. I personally haven't used a screen saver regularly for a number of years, so I can't speak authoritatively or from experience; however, I believe the monitor's power-saver mode should not affect the function of any macros, though - again - you may want to test this.
  9. Ahhhhh FANTASTIC!!!!! Thanks, Stan! I knew it was going to be something simple and easy. I was just looking in the wrong place (Files/Folders, rather than the just-as-obvious Variable Set Integer)!!!
  10. I'm cracking open a new topic for this, thanks to Terry. This is splitting from the "Hot Topic": MEP slowing machine down dramatically . I have never had "Auto Restore Hooks" selected, but I've experienced the slow-down described in that thread for a long time. I did, just now, select "Auto Restore" because I've been having issues where some of my macros that are generally very reliable will suddenly stop working until I manually restore the hooks. Based on Chris and Terry's comments quoted above, I'm curious about this function. Should I expect my keyboard hooks to work 100% of the time now? Am I going to still need to restore them manually? Does anybody else have concerns about hooks being dropped? Have I completely missed the boat?
  11. Ahhhhh ok ok, I get it! Took me a while, and I had to read stuff I skimmed over before... Now that I actually take the time to look at your code I finally understand what it was you were trying to do. I ran into a similar problem a couple of years ago trying to get information within a Text File Process loop to get stored into incrementally higher %T% variables: Put specific info from line 1 into %T10%, info from line 2 into %T11%, etc.. I did run into a snag, which it looks like you've already got covered. If you start in a single-digit variable, say %T8%, when it increments to double-digits, it screws up mightily, so you want to start in the double-digits... or take the time to write code that checks for and fixes the "changeover," which I never bothered with. I hated having to figure out the DE code in order to plug it into the Scripting editor. I'll try to find the thread I had going where I thought I had it all figured out and posted it, only to have Kevin come in later (I think it was Kevin) and correct it. It was a brilliant correction, too, which I appreciated. Of course, now I've forgotten it all. But let's see (maybe it's one of the threads Kevin linked to in this threat, as well)... ... Yes, I see Kevin did link to one of my earlier posts: Here it is again That's not the post I was referring to, however. I'll keep looking and either edit this one, or add a reply to it.
  12. Pat, I think I can address part of your question. I've been trying for years to find a way to convert .xls files to .csv files invisibly. I've finally concluded that Macro Express can't do it. You can build a macro that can rename the file from an open Excel document, and that works, but it's not invisible, and since it relies on mouse-moves and/or tabs, there is a great deal of room for error. Generally, it's easier to have the macro pause while you manually save the document as a .csv, and then resume it... but that's not what you're trying to do. In my experience, this is the easiest and most secure way to create a .csv from an .xls. There may be other options, however. If there is a way to have the database information load directly to a .txt or .csv, that would be my first suggestion; though I wouldn't have a clue about how to do that.
  13. I'm tweaking a macro with a very basic If/Else sequence in order to improve, if only slightly, a macro I currently run about 5 times each day. If you want details about why I want to know this, please read below; otherwise, the question is simple: Does Macro Express have a command to extract the size of a file directly? I can't seem to find one. If so, what is it? If not, does anybody have an easy work-around? ____________________________________ Situation: I have to run this macro against 5 different .txt files which range in size from just a few KBs to several hundred MBs. Generally, they look like this: A.txt = 14 MB B.txt = 5 MB C.txt = 60 MB D.txt = 250 MB E.txt = 58 KB The .txt files are set to variable %T10% via a prompt to the user to browse to and select the file. A and B usually take between 10-30 seconds to process, C and D take between 2-6 minutes, and E is pretty close to instantaneous. Because some of these processes take a while, I have a set of Dialog Boxes that update at each increment of 10% progress. This is fine for the slow ones, but it slows down the really fast ones. Currently, I have an ugly "If Variable %T10% contains E.txt / Then Skip the Dialog Box" (it's actually an If contains E.txt OR If contains E2.txt... and it could get longer as I tweak it). I would like to have a simpler statement along the lines of "If File %T10% < 1MB / Then Skip the Dialog" Or something similar. I'm sure it would include Integer Variables. If I could just find some easy way of collecting that file size. This would be built against a future where the sizes of these files could fluctuate. The E.txt file may be the small one now; but in the future, it could be large, too, and the updates would be beneficial. Likewise, A and B files are occasionally much smaller, and wouldn't need the updates to be displayed. Maybe the answer is obvious and I'm just not seeing it. Any help would be appreciated. Thank you!
  14. Jim, I'm glad you got it figured out. I'll take a look at it again later, when I have a minute, but on first glance, it looks like you already know the loop will run 5 times, so you could just set N9 to 5, and your other integers accordingly (N1=1, N2=2, etc.), but I'm most likely missing something important, which is why I'll look again later. Right now I have to rush out the door.
  15. It's all in the code. It's all in the code. Hey Terry, The \s you saw is ME3's way of ending a command line in DE code. It's the "code" version of generally un-typeable box-like symbol. I believe you have Joe's Macro Express Explained. He explains it WAY better than I just did.
  16. I think you might be looking for a more complex solution than is strictly needed.... This is actually a lot easier to do than your post was moving towards. If you want to set %N9% to %N10%, you simply need to use the Variable Set Integer command to accomplish this: Variable Set Integer %N9% to %N10% <IVAR2:09:01:%N10%>[b]
  17. Empty Folders (and other missing files), the bane of my macros......... Nice find, Terry! I hadn't even thought about running it against an empty folder. I just tried it with ME3, and though I don't get a "Line 27" error, I do get a "file cannot be found" error (the temp1.txt file). That's something that I think could be fixed with a brief "if not file exists / create file" sequence, but I'd have to look into it a little further.
  18. Registry: A New-ish File System......................... I may be wrong about this, but the Registry is essentially a file-system like any other on your computer. But instead of being dependent on C:/ D:/ etc. and file paths set up on the surface, the paths take a back-door approach instead. It's this "back door" that makes them a little more... um... risky isn't the right word. But you want to be cautious when you go in the back door, because that is also how you get to a lot of very sensitive system files that you really don't want to mess around with. Unless you are a real programmer. So, when you go in the back door, you stay away from the folders that you don't know anything about (in my case: all of them), and you just create new paths which create new folders - the contents of which are all yours, to do with as you please. To create these paths using ME, you just go to the System commands, select Read or Write Registry (in ME3, you have to specify whether it's a decimal, integer, or string - MEP does away with these distinctions). Then you just Browse to the path where you want to set up your personal Registry folder... I've heard it recommended to use the HKEY_CURRENT-USER (HKCU) folder, which is the one I use. You can also use HKEY_LOCAL_MACHINE (HKLM). The difference being that HKCU is accessible to you only, while HKLM is accessible to anybody using your machine. Then you create the rest of the path by typing it out. Example, if you open the HKCU folder, you get a slew of system folders that you don't want to touch. So just make sure you've selected the HKCU, so the path bar says: Path: HKEY_CURRENT_USER\ And now you just add to that the path you want to create. Example: Path: HKEY_CURRENT_USER\ME3Variables\TestFolder\ This will create the new sub-folder under the HKCU: ME3Variables and a sub-folder to it: TestFolder Note: I don't use spaces in my Registry folder and file names... I am certain you can... because some of the built-in system files do... but I didn't know that for sure when I started, now I have a habit. Easy as pie. Easy as eating pie. Easy as throwing a pie in the face of %politician of your choice%. Anyway, I'm far from an expert, but I was terrified of using the Registry, until a few helpful posters on these boards were able to lift the veil of ignorance from my eyes a little at a time. Now I just use caution with it - like anything in life that is a little dangerous, but extremely useful (fire, knives, and Axe Body-Spray come to mind). If you want to change the Read/Write commands, you can. You can make the variables pull from (using Set Variable from file) and save to (using the 2nd tab of the Modify String command) .txt files. Your results will be essentially the same. I've just gotten into the habit of using the Registry, because it's easy, and possibly faster.
  19. Ok, Pat, you made me work for this.............. Here's what I've got. It works, and I like it. However, there may be a more elegant way (I always feel like that when there are multiple If/Else/End If sequences together). It does more than you asked for: If the number of files match, it tells you if any of them are different. It specifies which files have been removed and which ones are new If there are fewer files now than before, it tells you which ones have been removed. If there are more files than previous runs, it tells you which ones are new. I didn't take the next logical step, which would be to point out if files were removed, even if there are more files now than before; and likewise to point out if new files were added, even if there are fewer items now than previously. Using the logic of the macro as it is, I am sure it won't be too hard to figure out how to do that. Switch / Case functions might be useful for streamlining this macro, but I honestly have no idea how their logic works. As it stands, this macro works great, if a little longer than expected (considerably longer than the original). I'm putting the attachment before the Script because... well, the script is LONG (even more now that I've added Remarks): Count_Files.mex // T1 - Folder Path // T2 - File Name(s) within Folder (T1) - Only 1 at a time // T3 - Previous Contents of Folder (T1) // T4 - Current Contents of Folder (T1) // T5 - Receiving Variable for Text File Processes // T5 (continued) - Missing and/or New Items // T10 - File Name // N1 - Number of Previous Items // N2 - Number of Current Items // Select Folder Variable Set String %T1% from Folder Name Variable Set String %T10% from Environment Variable Convert Filename "%T10%" to a long filename and store in %T10% Delete File or Files: "%T10%Temp1.txt" Delete File or Files: "%T10%New Items.txt" Delete File or Files: "%T10%Missing Items.txt" // Read Registry Read Registry Integer: "CountFiles%T1%" Read Registry String: "StoreFiles%T1%" // Process Items in Folder Repeat with Folder Variable Modify Integer: Inc (%N2%) Variable Modify String: Append %T2% to Text File Repeat End Variable Set String %T4% from File: "%T10%Temp1.txt" // Write New Info to Registry Write Registry Integer: "CountFiles%T1%" Write Registry String: "StoreFiles%T1%" Variable Modify String: Save %T3% to Text File // Detect New Items Text File Begin Process: "%T10%Temp1.txt" If Variable %T3% does not contain variable %T5% Variable Modify String: Append %T5% to Text File End If Text File End Process // Detect Missing/Removed Items Text File Begin Process: "%T10%Temp3.txt" If Variable %T4% does not contain variable %T5% Variable Modify String: Append %T5% to Text File End If Text File End Process // Establish Results // ~~~1. Same number of Items If Variable %N1% = variable %N2% // ~~~1a. Items do not match 100% If File Exists "%T10%New Items.txt" Text Box Display: Files Changed Program Launch: "%T10%New Items.txt" Window Reposition: Top Left - New Items.txt Variable Set Integer %N10% from Width of Window Program Launch: "%T10%Missing Items.txt" Window Reposition: Missing Items.txt - (Left: %N10%, Top: 0) Else // ~~~1b. Perfect Match Text Box Display: No New Files End If Else // ~~~2a. More Previous Items Than Current If Variable %N1% > variable %N2% Text Box Display: Some Files Removed Program Launch: "%T10%Missing Items.txt" Window Reposition: Top Left - Missing Items.txt Else // ~~~2b. Fewer Previous Items Than Current Text Box Display: New Files Detected Program Launch: "%T10%New Items.txt" Window Reposition: Top Left - New Items.txt End If End If // Delete Temp1.txt but leave the other Temp files for reference // (until macro runs again and they are deleted). Delete File or Files: "%T10%Temp1.txt"
  20. Counting files in a folder, using ME 3...... Hi Pat, I love questions that make me learn new ME tricks. This is one of them. It wasn't terribly difficult, to do, either. My code uses Registry reads and writes, but those can be easily replaced by .txt or .ini files if you're hesitant about registry - I was until only a few months ago. They aren't nearly as scary as I had previously thought, if you don't mess with any system values. Stick within your own home-made registry folders, and you should be fine. This particular macro will prompt you to point to the folder you want to have counted, then it will count the files within that folder. It isn't set to count the files within sub-folders, however. If you know which folder will need to be counted every time, then you can eliminate the prompt. Please note that if you use the prompt, the macro will record different values for each folder you count. This way if you have to count the contents of multiple folders, you only need one macro and it will never confuse the contents of any two folders (unless you somehow have two folders with the same name on the same file-path... though I'm pretty sure that isn't possible). Here's the code: Variable Set String %T1% from Folder Name Read Registry Integer: "CountFiles%T1%" Repeat with Folder Variable Modify Integer: Inc (%N2%) Repeat End Write Registry Integer: "CountFiles%T1%" If Variable %N1% = variable %N2% Text Box Display: No New Files Else If Variable %N1% > variable %N2% Text Box Display: Some Files Removed Else Text Box Display: New Files Detected End If End If To avoid text-wrapping conflicts, I'll provide the DE code as an attachment. Count_Files.mex
  21. I hate your idea................................. Not really, but I thought it made a good "header" I don't think this is necessarily a very convincing argument to use Outline mode. I also think your use of the term "more efficient" is highly subjective. I recognize the fact of "efficiency" presented by the Outline mode in the sense that it makes efficient use of screen-space and indexing; however I argue that it is actually less efficient in terms of mouse-involvement and ease of reading everything quickly. eg. In Outline mode, I can jump to whatever post I want to read, but - especially in longer threads - I may miss something important, possibly missing exactly the post I needed to see. I can also distinguish who replied to whom on which post in particular, which can be extremely useful, particularly - again - on longer threads where a response to a direct question falls several posts later, with possibly off-topic responses chronologically in-between. Thus: Lots of mouse-moves and clicks, with potential for missing pertinent information. ____________________________ In Standard mode, however, I can just read from start to finish, using my enhanced powers of reason to figure out which posts are replies to which other posts. If ever my deductive reasoning is thwarted by horrifying grammar, syntax or just plain "huh?"-ness, I can either ignore, or switch to Outline mode and hope that the poster at least followed that procedure. Thus: Scroll wheel involvement, nothing more. Maybe a move/click to get to additional pages, but that's it.
  22. I'm torn on this. I understand that from time to time the reason something won't work is because I want it to work a specific way, and that isn't possible. However, if you get too general, you may get a whole lot of "help" that is completely irrelevant to what you're trying to do. Which can be fun and even highly informative and educational, albeit time-consuming when sometimes time is of the essence. So yeah, generalities, but specific generalities
  23. I'm with Paul. I'm not immune to typos and so I can generally forgive or even blindly ignore accidental uses of apostrophes and "teh"s and other incidental, quick-fingered errors. But please try to keep your there, their, they'res straight. And your and you're. And... oh, let's not forget then and than. These errors are occasionally typos, but more often they're a sign of laziness. Or lack of education.
  24. Cory... are you talking to me? I know I'm long-winded, but... um... I actually have nothing to follow that up with. This I agree with... though I thought using the code and codebox tags were important to keep the code 'intact'. Because of the problems with the side-scrolling, I alway try to keep my actual text narrow enough to prevent the need for side-scrolling. I'll try this new technique of avoiding the forum's broken code/codebox tags yeah... I like the concept...
  25. I may be confused, but in my experience Ctrl+c works wonders for copying selected text to the clipboard. Unless you're saying that the mere act of highlighting text executes the copy function. If that is the case, then I would imagine you could build a macro that would do it, but not reliably. Macros in Macro Express can be set to execute upon mouse-click, but the action occurs when the button is pressed, not when the button is released. Macro Express Pro has settings that allow for the release of keys before activation, but not mouse-clicks. So what you would end up having to do, based on my very brief study of the situation, is build a macro the does a "Mouse Down" followed by a delay for how-ever long you think it will take you to highlight text (you'll want to establish a longer-than average delay), and follow that with a "Mouse Up" and a "Clipboard Copy" command. I built one really quickly and it worked well enough. I'd rather use Ctrl+c Or better yet, I would rather just use my mouse's extra buttons. I have one set to copy and the other to paste. Works beautifully and I never have to worry about screwing up my clipboard just because I clicked on something.
×
×
  • Create New...