Jump to content
Macro Express Forums

randallf

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by randallf

  1. hrm... Is there just a way to take a line in a CSV such as: data1,data2,data3,data four4,,more data,,,stuff,lol = lulz And copy each value into T2, T3, T4, T5, T6, etc? I was working on something weird like (VERY unfinished) Text file begin process (line 2 into T1) Set integer from position of text in variable: , (N1) [this gives us the position of the first comma] Variable modify string: copy part of T1 into T21(case number) from pos zero to N1 N2 = N1 Repeat until N1 > 200 [sets the limit for how far down a line it should scan] LET N1 = N1 + 1 Variable Modify String: Copy part of T1 (single char @ pos.N1) into T2 IF VAR T2 = , LET N3 = N2 [this gives us the stopping point, N3 is always the last stopping point] Variable Modify String: Copy part of T1 into some variable (from [this moves us to the next position after the comma] ELSE LET N2 = N2 + 1 And then I got lost I think I could write the loop to continously push things into a new variable but how do I get it to step the variable up each time it runs the loop, like use T1 and then T2 and then T2... :unsure: I need a brilliant guru programmer to help me out here! Huge thanks in advance to anyone who takes the time here... -Rand
  2. To clarify a bit more I want to be able to make a loop as follows: Process this CSV(text) file Go to line 2 and get records 1, 2, 3, 7, 14 and 17 Save these records into variables Move to another program and enter the data Text file end process (do it all again until no more lines are available) I am trying to move away from screen controls to do my data mining as it's so much faster with text file process...
  3. How about doing something with tab-navigation and 'move mouse to cursor position' and then grab the mouse pos...
  4. Hello fellow .MEXiCANs... I am using text file process to pull data, I have several formats I can save the data in and the resulting lines are something like this: 18172865-0413,owner,Open-Dispatch,OPN-Pending,Help Desk Level 1,Site Name,P5-NoRush@Cust Reqst,P4 - Standard,Userlast,Userfirst,BIG LONG CASE TITLE STRING,90111116,,693379621,R045824020 What I want to do is be able to grab individual segments out of this. Currently I have tried using non-csv (just text) formatting and the following sort of loop: <REM2:Case ID><TMVAR2:10:02:01:001:013:><REM2:Status><TMVAR2:10:03:01:023:013:><REM2:Priority><IVAR2:04:13:1:Namename><NMVAR:01:04:1:0000004:2:0000008><TMVAR2:10:04:01:N04:002:> // Case ID Variable Modify String: Copy Part of %T1% to %T2% // Status Variable Modify String: Copy Part of %T1% to %T3% // Priority Variable Set Integer %N4% from Position of Text in Variable %T1% Variable Modify Integer: %N4% = %N4% + 8 Variable Modify String: Copy Part of %T1% to %T4% The problem is with the normal formatting that it comes out with no easy way to scan for the data that I want, however, in CSV format you can see (or already know) that every record has a , (or ,, if the record is blank) and I need a way to count out to a certain , placing and grab the text placed thereafter. Is there a way to use increment/decrement to do this? Has anyone else had success processing variables out of CSV files based on placement?
  5. As an afterthought since I am already using excel to track some of this data I may just use an excel formula to do this rather than ME.
  6. Hello! I have been writing macros for awhile, some of them have to do with time. Anything I have written for time is a MONSTER of a function for something that I feel should be much simpler... Here is my timestamp: 04/08/2009 09:23:43 AM I need to be able to just grab that stamp and tell numerically how many hours have passed since that time. I have at least two functions that I think will acomplish the task but after reading a lot of others work (and because I generally am self-taught with nobody to compare notes with locally) I think that there are probably better ways. So, most divine ME3 gurus: What is the best way to tell how many hours and minutes have passed since 04/08/2009 09:23:43 AM using ME3? -Rand
  7. What if I install it to a portable memory stick?
  8. Hello, I was wondering, if I purchase a macro express pro license for myself, does this permit installing it on my (just mine) work PC and using it in the course of business/production as long as I am the only one using it? My company has a ME3 license but not pro. I want to use pro at work for myself instead of ME3. Thanks!
  9. I have worked a lot with macro express and have supported citrix clients for a long time; The short answer is: no. ME won't (more accurately, cannot) leave citrix. Sorry! More or less, in a Citrix session you can only interact one way without special tools or plugins. If these exist for this purpose I do not know, but unfortunately it just doesn't work that way. Chances are you could come up with a set of macros running on the local PC and in citrix that work well together!
  10. It will probably refresh the system tray icons if you drag the start bar to the side of the screen, release, and then drag it back. Now if only there were some way to automate that, so you could instantly fix it... hrm...
  11. Have you tried 'wait for file to be ready' on the batch file? It might be willing to wait until the batch file closes and then take action. The file shouldn't be 'ready' until no program has a hook on it (like wscript or whatever runs them now).
  12. You could use window positioning instead... if you are willing to be constrained by not being able to move the windows around much... In one of my macros I use a loop that goes to the top of the title bar, detects pixel color, stops and double clicks, then runs commands on the window and then clicks on the restore button. You can use mouse move to location very easily that way as long as you don't change your screen resolution. I use this in Clarify where all of the program windows are embedded into the program itself and don't have windows GUI hooks. You could have the windows tiled out on your desktop, then put your mouse in the window you want the macro to run on (particular windows could always be in the same position for further automation) and hit the macro, it scans upwards, finds the title bar and double clicks to maximize it, runs the macro, restores the window and you move on with your life! It might not be 'wait for window title to become active' but it's better than nothing, no? -Rand
  13. Here's a loop I wrote to scan upwards for the 'blue' in the default windows titlebar and then double click to maximize, short on time but maybe this can help you guys a bit (or maybe I'm waaaay off lol): You can probably ignore the part between the end if's - it just tries to check for if the mouse hit the next titlebar up (i.e. if it 'missed') Repeat Until %N99% = 1 Mouse Move Position 0, -1 Get Pixel: Under Mouse into %N98% If Variable %N98% = 15357184 Variable Set Integer %N99% to 1 End If If Variable %N98% = 8388608 Variable Set Integer %N99% to 1 End If Repeat End Delay 0.2 Seconds Mouse Left Button Double Click <DIS:<TEXTTYPE:FIND ACTIVE CASE TITLE BAR><REP3:08:000001:000002:0099:0:01:1><MMP2:0,-1><GETPXM:98><IFVAR2:2:98:1:15357184><IVAR2:99:01:1><ENDIF><IFVAR2:2:98:1:8388608><IVAR2:99:01:1><ENDIF><ENDREP><DIS:<TEXTTYPE:DOUBLE CLICK BAR TO MAXIMIZE CLARIFY><DELAY:.2><LDCLK>
  14. I have run into problems before with window controls... when I save a line using the get control utility and then restart the program the macro won't work right until I run the get control utility again.... maybe you are experiencing a similar problem? My philosophy is when all else fails copy and paste the macro, delete what you're working on and write it again from scratch. If you used the running window titles menu to grab the menu title instead of entering it manually (remember that it WILL accept a partial match even if it doesn't begin with the word - such as "Microsoft Outlook" in that field WILL find the "Calendar - Microsoft Outlook" window) then you may need to go back in and select it again or manually enter a partial title. In other words: Recreate the line! Hope that helps! -Rand
  15. Hey casper thanks a bunch for the reply, always good to get feedback on anything though I haven't really had a chance to look yet. Eventually I'll make some changes and post them up.
  16. Here is a macro I wrote thats basic function is to scan line by line through a text file searching for certain words and take action if it finds them. I post this because maybe someone will find this module useful. I will post this in it's entire form; it is meant to search for the words 'break' or 'lunch' then find the times and create an outlook appointment for each. The initial copy is data from our workforce management program. I think this might interest people because it works on a loop, rather than writing a macro that would just grab the times with whatever handy method, I used a loop so that I could create a module for scanning files and use it again later, and not just have one dumb breaks macro... Clear All Variables: All Clipboard Empty Text Type: GRAB DATA INTO NOTEPAD Clipboard Copy Launch and Activate: "notepad.exe" Clipboard Paste Text Type: DATA MINER Text Type: <ENTER><CTRLD><HOME><CTRLU> Text Type: <SHIFTD><END><CTRLU> Clipboard Copy Variable Set String %T5% from Clipboard Clipboard Empty Repeat Until %T1% = "" Text Type: <HOME><SHIFTD><END><SHIFTU> Clipboard Copy Delay 0.1 Seconds Variable Set String %T1% from Clipboard If Variable %T1% contains "Break" Text Type: <HOME><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE> Text Type: <CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU> Clipboard Copy Variable Set String %T2% from Clipboard Text Type: <DELETE><DELETE> Text Type: <CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU> Clipboard Copy Variable Set String %T3% from Clipboard Activate Window: "Microsoft Outlook" Delay 0.1 Seconds Text Type: <ALTD>F<ALTU>wa Text Type: BREAK Text Type: FILL OUT APPOINTMENT Text Type: <TAB><TAB><TAB>%T5%<TAB>%T2%<TAB>%T5%<TAB>%T3% Delay 0.5 Seconds Activate Window: "Notepad" Text Type: <ARROW DOWN> End If If Variable %T1% contains "Lunch" Text Type: <HOME><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE> Text Type: <CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU> Clipboard Copy Variable Set String %T2% from Clipboard Text Type: <DELETE><DELETE> Text Type: <CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU> Clipboard Copy Variable Set String %T3% from Clipboard Activate or Launch: "Inbox - Microsoft Outlook" OR "OUTLOOK.EXE" Text Type: <ALTD>F<ALTU>wa Text Type: LUNCH Text Type: FILL OUT APPOINTMENT Text Type: <TAB><TAB><TAB>%T5%<TAB>%T2%<TAB>%T5%<TAB>%T3% Delay 0.1 Seconds Activate Window: "Untitled - Notepad" Delay 0.1 Seconds Text Type: <ARROW DOWN> End If If Variable %T1% does not contain "Lunch" AND If Variable %T1% does not contain "Break" Text Type: <ARROW DOWN> Delay 0.1 Seconds End If Clipboard Empty Repeat End Text Type: <ALTD>f<ALTU>xn Multiple Choice Menu: Breaks on Impact If Variable %T10% = "A" Repeat Until %N1% = 1 If Window Title "Appointment" is running Activate Window: "Appointment" Text Type: <ALTD>f<ALTU>cy Else Variable Set Integer %N1% to 1 Delay 0.5 Seconds End If Repeat End End If If Variable %T10% = "B" Repeat Until %N1% = 1 If Window Title "Appointment" is running Activate Window: "Appointment" Text Type: <ALTD>f<ALTU>cn Else Variable Set Integer %N1% to 1 Delay 0.5 Seconds End If Repeat End End If <CLEARVAR1:A:ALL><CLIPE><DIS:<TEXTTYPE:GRAB DATA INTO NOTEPAD><CLIPC><LAUNCHNO3:0:0112Untitled - Notepad<LAUNCH:C:\WINDOWS\notepad.exe><CLIPP><DIS:<TEXTTYPE:DATA MINER><TEXTTYPE:<ENTER><CTRLD><HOME><CTRLU>><TEXTTYPE:<SHIFTD><END><CTRLU>><CLIPC><TVAR2:05:03:><CLIPE><REP3:08:000001:000001:0001:0:01:><TEXTTYPE:<HOME><SHIFTD><END><SHIFTU>><CLIPC><DELAY:.1><TVAR2:01:03:><IFVAR2:1:01:7:Break><TEXTTYPE:<HOME><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE>><TEXTTYPE:<CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU>><CLIPC><TVAR2:02:03:><TEXTTYPE:<DELETE><DELETE>><TEXTTYPE:<CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU>><CLIPC><TVAR2:03:03:><ACTIVATE2:Microsoft Outlook><DELAY:.1><TEXTTYPE:<ALTD>F<ALTU>wa><TEXTTYPE:BREAK><DIS:<TEXTTYPE:FILL OUT APPOINTMENT><TEXTTYPE:<TAB><TAB><TAB>%T5%<TAB>%T2%<TAB>%T5%<TAB>%T3%><DELAY:.5><ACTIVATE2:Notepad><TEXTTYPE:<ARROW DOWN>><ENDIF><IFVAR2:1:01:7:Lunch><TEXTTYPE:<HOME><DELETE><DELETE><DELETE><DELETE><DELETE><DELETE>><TEXTTYPE:<CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU>><CLIPC><TVAR2:02:03:><TEXTTYPE:<DELETE><DELETE>><TEXTTYPE:<CTRLD><SHIFTD><ARROW RIGHT><ARROW RIGHT><CTRLU><SHIFTU>><CLIPC><TVAR2:03:03:><LAUNCHYES3:0:0112Inbox - Microsoft Outlook<LAUNCH:C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE><TEXTTYPE:<ALTD>F<ALTU>wa><TEXTTYPE:LUNCH><DIS:<TEXTTYPE:FILL OUT APPOINTMENT><TEXTTYPE:<TAB><TAB><TAB>%T5%<TAB>%T2%<TAB>%T5%<TAB>%T3%><DELAY:.1><ACTIVATE2:Untitled - Notepad><DELAY:.1><TEXTTYPE:<ARROW DOWN>><ENDIF><IFVAR2:1:01:8:Lunch><AND><IFVAR2:1:01:8:Break><TEXTTYPE:<ARROW DOWN>><DELAY:.1><ENDIF><CLIPE><ENDREP><TEXTTYPE:<ALTD>f<ALTU>xn><MENU2:2:T:10:CenterCenter:Breaks on ImpactPlease choose an option or cancel:Save ALL open appointments Cancel ALL currently open unsaved appointments ><IFVAR2:1:10:1:A><REP3:08:000001:000002:0001:0:01:1><IFOTH:04:2:Appointment><ACTIVATE2:Appointment><TEXTTYPE:<ALTD>f<ALTU>cy><ELSE><IVAR2:01:01:1><DELAY:.5><ENDIF><ENDREP><ENDIF><IFVAR2:1:10:1:B><REP3:08:000001:000002:0001:0:01:1><IFOTH:04:2:Appointment><ACTIVATE2:Appointment><TEXTTYPE:<ALTD>f<ALTU>cn><ELSE><IVAR2:01:01:1><DELAY:.5><ENDIF><ENDREP><ENDIF>
  17. You can use 'get control' and all the window controls stuff to grab the text from a dropdown box in many applications. Things like (when tabbed to dropdown) get text from control store text to var down arrow repeat Have worked well for me for mining data. Not sure if this is your aim but it seems that you would need this for anything interpretive (where you didn't already know what you would see ahead of time)... but as always with macros: whatever works! Though seriously ME 3 needs a 'select from dropdown menu' and other dropdown functions like nothing else... this has limited me in so many ways so many times.
  18. I think I see what you are getting at: you see that more is possible but you aren't sure where to head. I realized frequently over the years that I simply didn't know a certain thing was a candidate until long after the fact. One thing that I can recommend is just to pay attention to repetitive tasks. Things like filling out an email that is a standard form using data taken from applications are generally great candidates for automation. With resources like this forum there is almost no technical limit to what you can do, you just have to identify the task as something that fits a process... macros CAN account for changes and check data and respond to parameters based on input, etc. Even fields with many possible entries can be boiled into lists and selection menus to reduce keystrokes. If you can describe in more detail what it is that you do I am certain we can make some suggestions. Edit: as a programmer, you probably have a lot of back-office crap to do... TPS reports or bug analysis or standard forms... maybe you can make a macro that saves your current project to a certain file for you, or something that emails your boss at the end of the day or whatever... In more complex and technical roles I have successfully used macros to all but eliminate the administration and forms and other bullshit and just be able to concentrate on the technical nature of the work!
  19. Forgive me if I'm wrong or out of context... but isn't the file extension "MEX" not "MXE"? If you named them incorrectly the default handling in windows for launched filetypes won't be handled right and the file probably will fail to launch or maybe pop up an 'open with' dialogue... Just a thought... sounds weird to me. Doesn't seem to be a macro problem... are you on Vista? Maybe try taking ownership of those files again or set macro express to always run as admin...
  20. The briefcase is a macro that copies the current case number that is open in Clarify the the clipboard. R populates reactive escalation emails for me, using data that it mines from Clarify. G logs me into a citrix system that is a pain in the butt to log in to! The book loads up the process webpage for the account I am primarily in charge of. The deer is a near 1000 line macro that evaluates cases for their acceptance and resolution SLA's based on the current time and what the SLA's are. It took me like 2 days to write it! It also emails people automatically after mining data and will create reminders in outlook for you based on the ticket data... in all my BASIC I have never written anything this complex. The clock creates a reminder in Outlook with data that it mines from the current open ticket in Clarify. The eyes open and close a particular program for me. Hope that was even remotely interesting! lol
  21. How can I make the top toolbar look more like the bottom? I seriously don't understand why the floating menu has to take up twice the vertical space just so it can say 'MENU BAR' or whatever with an X... I'm sure this is a part of the windows themeology but _why_oh_god_why....? Is there any option to toggle this? Maybe in a later version?
  22. Thanks Kevin, but I *think* it is just so much simpler in 24 hour format that not to just use 24 hour is crazy... Can it really be this simple?!?! Format: 01:23 PM N1:N2 T1 (edit... guess i needed an AM function) Convert to 24 hour: If Variable %T1% = "PM" If Variable %N1% < 12 Variable Modify Integer: %N1% = %N1% + 12 End If End If If Variable %T1% = "AM" If Variable %N1% = 12 Variable Set Integer %N1% to 00 End If End If
  23. Hello everyone, have you tried: Repeat Until %T1% <> "" Clipboard Empty Clipboard Copy Variable Set String %T1% from Clipboard Repeat End Seems like it should work almost anywhere, but who knows if you've tried it! Love to know what you think because the clipboard speed gets me, too. Thanks for helping me see it in a different way! Here is what a lot of my stuff looks like because I am way too lazy: Clipboard Copy Delay 0.1 Seconds
  24. I think you can infer it: Grab mouse position into var1 Move mouse to tray icon command Grab mouse position into var2 if var1=var2 mouse didnt move and try icon is not present if var1=/=var2 mouse moved and must have gone to tray icon Note that if the icon is 'hidden' in the tray behind a collapsed view this would not work.
  25. The macro I am working with is HUUUGE... over 640 lines now... Here is the function that I made but it doesn't work right. Probably the AM/PM crap messing me up. I'm ganna rewrite the thing from scratch using 24 hour formats within the program... basically whenever the macro mines any data and stores variables it will convert it at that time to 24 hour format, use only 24 hour format in calculations and export in 24 hour format. It's a sacrifice I'm very willing to make at this point. HOWEVER thank you very much for the helpful info, I learned a lot by working with this. Text Type: CALCULATE EXPIRY DURATION Variable Modify Integer: %N33% = %N31% * 60 Variable Modify Integer: %N33% = %N33% + %N32% Variable Modify Integer: %N34% = %N1% * 60 Variable Modify Integer: %N34% = %N34% + %N3% If Variable %T33% = "PM" Variable Modify Integer: %N33% = %N33% + 720 End If If Variable %T1% = "PM" Variable Modify Integer: %N34% = %N34% + 720 End If If Variable %N34% > variable %N33% Variable Set String %T9% "NOT EXPIRED" Variable Modify Integer: %N35% = %N34% - %N33% Variable Modify Integer: %N36% = %N35% / 60 Variable Modify Integer: %N37% = %N36% * 60 Variable Modify Integer: %N38% = %N35% - %N37% .... and some comments and End If
×
×
  • Create New...