Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by Cory

  1. I too have seen the failure of macros in Remote Desktop (AKA Terminal Services) machines. At first I faulted ME but after closer scrutiny, in my case at least, I found that it wasn't ME's fault. In two sepperate cases, both using IE6, I found that the problem was that IE won't do certian things when a TS session is minimized or disconnected. In the latest case the authentication dialog box refuses to open so ME can enter a password. This was a real bind becasue at the time I was using ME to download an entire Yahoo group with nearly 40k messages and I was using as many as 5 machines on different networks to do it before the group shut down. The workaround I found was to have a normal desktop session and use VNC to connecto to the desktop. It's free, thin and very usefull. You still have to have teh zombie computer like Kevin suggests but at least you can remote to it. FYI, the current version is 3.5d. If you are having any problems you might consider upgrading.
  2. I wholeheartedly agree. I tend to critisise ME's shortcomings but it's like looking a gift horse in the mouth. Still it doesn't hurt to ask for enhancements. You should formally request this here. The guys are real receptive about this sort of thing.
  3. I can only think of a couple of possible workarounds. If it were me I would first consider: 1- You could run a loop for every file in the folder and put the delete command inside an "If File ready" so it will skip any that have locks. 2- You could use the DOS command "DEL" instead of the ME file deletion. This won't pump it to the recycle bin.
  4. I'm sorry I don't have time to review your code right now but I would like to suggest you use the If Ping Successful command instead. This way you don't need to open a browser and all that jazz.
  5. I need to change a ton of folder and file permissions on an NTFS volume following a certain algorithm which would mean changing thousands of file done manually. I plan no using ME to do this for me following a logical pattern using the NTFS permissions command line utility called Xcalcs . Has anyone had any experience doing this? I was just hoping that I might shorten my time if I could learn from a master’s experience. Also if any of you have a firm understanding of the more advanced NTFS permissions and how best to set them up I would really appreciate some help. I’m even willing to pay.
  6. I agree with derfel in a way as I too was getting lost easily. But I decided line numbers are useless because as I keep adding and modifying they change. Some of my macros are 5 pages printed and I was having trouble keeping it all straight but then I found a trick. First I started using the remarks to annotate my stuff so just like in programming you keep record of what you are doing when but then I discovered that if you insert a remark and leave it blank it just inserts a blank line for you. So now I often put a single blank line between simple routines and a couple between larger sections after which I have a remark about what the next section is doing. I’ve even seen people who will put 3 remark lines, first and last consisting of 40 or so equal characters to make a visual line and the text in the middle all upper case describing what comes next or whatever. Since I’ve started doing this I’ve not lost my way. I agree with cybercheif also to an extent but I wouldn’t get too carried away with that. Personally I saw that I was often using the same routine in different macros so I started breaking those out into generic subroutines. I started to do as cyberchief said but it tended to cause more problems for me. I found that using the remarks I could quickly and easily keep them separate in one macro file. Also I was I use the find to navigate quickly by searching for something in my remarks like “Section 2” or “Find unique”. Also I try to write my variables used ina section in the remarks so if I want to see where I generated T12 I can simple search for it. I’m sure there are better ways and I will probably find something better in the future but this works for me now.
  7. I created this one to address the constant problem of deleting files on a network resource. In Windows 2000 and other places if you delete the file it simply disappears which could be disastrous if a macro runs afoul or a user makes a mistake. So this little gadget simply moves the file to a temporary folder on the local drive and deletes it from there thus moving it to the local user's recycle bin.
  8. This is a stand alone macro that breaks up a fax into several files. Describing the need is easier than the function so let me try that. I have a client that receives faxes as PDF but sometimes a fax will come in with a cover and individual pages for several participants. The standard is that a copy of each of these be saved per participant but we don't want the other pages germane to others in this filed copy. But we want to keep the cover pages. So this macro makes the necessary number of PDFs and deletes the superfluous pages. This is actually part of a much larger macro but this runs fine by itself. It's just not as clean as I would like for posting but I'm not going to spend the time. Basically it will ask you for the file, number of cover pages and the number of pages per participant. Then it will test to make sure the number jive with the total number of pages. Then it creates multiple files, deletes the original and parses out the pages.
  9. This macro subroutine checks the users email settings and updates them as needed. It checks the registry values in ME for email address, user name and SMTP server to make sure they are correct and changes them if not. The user is prompted if this is their name and email address and if not right allows them to correct it. I use this routine in macros where I use the email system or need the users email address. In general I like to use the registry to keep persistent settings for that workstation and usually define some in the miscellaneous key but in this case we need to adjust the ME email keys so ME can send email properly. In this case you will need to modify the macro for your SMTP server. Just replace the string IP1 with your server's address. Beyond checking to make sure the setting are correct for the email send command I often use these registry values for data entry. For instance I have macros that enter meta data in Acrobat files which include the creator's name. I get this value from this registry value. And obviously anywhere you need the user's email address you can read this registry value to string.
  10. This macro subroutine creates a reverse order date string from a file. The file name is passed from the parent to here where the date values are extracted and assembled into a reverse date order to be passed back to the parent. This is handy for file renames where you would like the files to keep the original file date and be in chronological order when sorted by name. I fond that the files are often moved to other machines causing it to loose the date stamp and also in some of my filing protocols we require the date first in YYYY-MM-DD format. However there are many uses for this.
  11. This is one that I use a lot when dealing with scanned PDF files and such. It basically takes a proposed file name and tests to see if it already exists. If it does it adds a numerical sequence on the end. Very handy for blind copies. Avoids the need to test for existence and re-prompt the user when the exact file name isn’t important. The routine doesn’t do any file manipulation but rather returns a unique name.
  12. This is one I plagiarized from a post and discussion. I made it a subroutine and use it a lot in my macros. So credit actually goes to others. I just wanted to put it out there where all could benefit in the future.
  13. Just before this form was created I made my own page to share subroutines I had and will make. Since I am constantly tweaking and upgrading them and adding more I decided to just keep them there and just post the links here. This first link is to the general page where all the individual macros can be accessed.
  14. I have a large macro I developed for a client that does a very similar thing but actually is part of a much larger picture. Faxes are received via WinFax which is set to print to a cheapo PDF print driver called 5D. At the moment a user periodically runs a "File disposer" macro that is designed primarily to update meta data in the PDF from user input which is read in by the user. IOW they look to see what the person’s name, company, SSN and other sort of info. This is then used to update the metadata in the PDF and create all the necessary folder structure and file away. This macro is used to dispose of all PDF’s be it from fax, scan, or generated from application so it’s a bit of a do-all. I reiterate, this is an on-demand kind of thing. I also have scanning macros to supplement this. These folks have two large Kyocera copy centers that generate PDF output. I have macros that force the user to jump thru a series of hoops so that everything is uniformly scanned and filed properly. The bit you would be interested in is my file monitoring. It starts by assuming the directory is empty. I use the “Wait for file exist” using “*.pdf” followed by a “Wait for file ready” (important) and then do my thing. It also is set up so that when it looks in the folder it takes the first PDF file and subsequently open the next. So in case two files arrive at nearly the same time or if there are several already in the folder it doesn’t mind. If you’re interested I could share this routine with you. In general I think I have already done everything you have but in a little different order. For logging I would suggest writing log files to a file. This is very simple to do. Then make it so that one file is generated per month or something so they don’t get too big. Check out my date generator for that. I’ll be posting a link in the third party forum in just a few minutes. In this case WinFax and or 5D could do the logging but I would use the file creation date if I were you. All phases could report to this file satisfying your audit trail. BTW I tried the monitoring for the next file name in a series thing and it failed. Problem was that if two arrive at nearly the same time it gets out of sync. Also if the macro is started and stopped the user has to do something to give it a start point again. This is why I developed the routine I mentioned above. I also have a cool email notification section for newly arrived and filed faxes if you’re interested. Works slick. As for you main problem of writing to a certain line I would simply create a log file entry for each event. Then you could use Excel, Access or even a simple filtering routine in ME to filter the results. Much simpler. But if you want to add lines I would make a CSV or TSV file and, say, make my entry in the first field as some sort of key like file name. Then if you need ot add to that row use the ASCII file process command with repeat to scan thru the entire file to search for that string in the first field. Grab that info and write at and the new info to a new CSV file. But seriously, it would be a lot simpler to have just one line per event and filter. If you would like any help on this project let me know. But I got a lot on in this thing so it might even be better to have a phone conversation.
  15. That's what I thought. The command name just throws me. 'taint right I tells ya. <g>
  16. Check out Joe's answer to a similar post.
  17. Not that I know of but that's something I would like to know so I’ll have to watch this thread. I’ve never considered it but in some of my routines it would be beneficial to check first to make sure there is enough room. The only thing I could think of would be to create a batch file to do a directory listing of the drive and write it to file. E.g. “dir f: /-c >filesize.txt”. The “/-c removed the thousands separators. Read the second to the last line to get the free space and figure out a clever way to eliminate all but the size. Or you could have ME recursively list all the files on the drive and sum the file sizes. Assuming you already know the size of the device you could subtract the sum of all the files from the devices size. Also you could simply try to copy the file to the disk and after the command check to see if it made it before deletion. If it didn’t display an error and don’t delete the file.
  18. I have been setting control variables using the Get Control Variable command but is this the best way? It doesn’t sound right, I would expect it to be called Variable Set Control but of course there is no such command.
  19. You're right of course about the CRLF and it points out a deficit in my explanation which I would like to address so I don’t look too ignorant. <G> The reason I mentioned it was that I often accumulate the entire results (what will be written to the file) in a string var. This way I’m not constantly hitting the file and do it at the end of the session. This is especially nice if working over a network where multiple users are accessing it. If the file is local and only used by one person there’s probably no benefit and therefore your suggestion is much cleaner. This reminds me of another suggestion for HeyJim though. I feel you should accumulate at least one record at a time before writing it to the CSV file. He wouldn’t need my CRLF suggestion for this but it will ensure that if the macro is interrupted he won’t have a partial fieldset for the record. This could be disastrous as if the macro was started up again and started writing to the end of the last incomplete line. As long as the users complete all the entries it wouldn’t be a problem but if you use validation routines there is a good chance that the user will just bail if they don’t pass one of the validation rules.
  20. I didn't realise this was an option, I'll have to try that! I think I'll buy your book now, been putting it off to long.
  21. I'm not 100% sure I follow but you mention using Text Type to create the file. This will work but a better approach is to write to the file directly. Use the Variable Modify String Append To Text File instead. It's very simple. Depending on your user input things may very quite a bit in structure but I would suggest a "New Enrollment" macro that prompts the user for each bit of client individually. "First name", "Last name", "SSN" and so on. Then show the user the data to confirm it’s correct after which ME could write all the variables to a CSV and or enter it in QB. Or better yet have ME prompt the user for all the info twice and compare to the previous value to ensure they entered it all correct! It won’t win you any friends but the data entry error rate will drop like a rock. A couple of suggestions I would offer: 1. Make some validation routines. My favorite is a repeat until variable not equal to null. This way they can’t just skip it. I’m going to make a subroutine soon that will test SSNs for validity, if you’re interested let me know and I’ll email you when it’s done. 2. Write a header to the CSV. Makes import mapping easier. Simply test that the file exists first and if it doesn’t create the header row. 3. Test the string vars for commas. If using a CSV file you will need to add quote marks around the entry if it does. Another option is to use a tab separated file instead to avoid this. 4. You will need to generate a CR+LF to put at the end of each line. You can steal my subroutine to do this. Also does TAB. If you need any help just ask.
  22. On one machine I use the registry for this, it's fast and therefore I don't have to worry about sleeping hard drives and subsequent timing issues. But it sounds to me like you want something many different machines to have access to. For this I suggest using a text file on a network share. I too have macros that create a folder structure each tmie a new client is added and to keep it straight I keep a file which is a list of that standard structure. This ends up being used for all sorts of things like audits to make sure users aren't changing anything.
  23. That's a good thought. But when I tried moving to the system hidden "Recycler" folder on my local machine the file just appeared next to the deleted items archives. IOW Windows wasn't smart enough to actually move it into the recycle bin. Oh well, my "Move to local hard drive first" method works and I guess the file needs to be copied over the network anyway so I guess there's no real time difference. The thing that tickles my imagination is somehting I found by accident. When you delete somethign on the network it just dissapears but if you delete somethign on the network that is accessed thru "My Documents" (redirect MD to a network resource) it will go to the recycle bin. So it just seemed to me that there should be a way....
  24. I want to have network file deletions in a macro go to the user's recycle bin. Is there an easy way to do this in one step? The best way I can see is to move the file to the local user’s hard drive and then delete it but that’s not very elegant. Any ideas?
  25. You're such a bum, didn't your father ever teach you to never look a gift horse in the mouth? Just kidding. There really are no sample files needed and things like registry values are created automatically. For instance the date string thing will work on any file. But what I probably should do is create a simple parent macro demonstrating how to ingress and egress and display results. I'll look into that later.
×
×
  • Create New...