Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by stevecasper

  1. Guliver, For what you're trying to do, you'll have to create a variable which contains the CR/LF values, then append that variable to your %T12% variable before appending the %T8% variable. Try this: // Based on your post, I will assume %T8% contains "The square" and %T12% contains "The balloon" Variable Set String %T8% "The square" Variable Set String %T12% "The balloon" // First we create the CR/LF variable: Variable Set %T1% to ASCII Char of 13 Variable Set %T2% to ASCII Char of 10 Variable Modify String: Append %T2% to %T1% // Now we can do what you were trying to do: Variable Modify String: Append " is red." to %T8% Variable Modify String: Append " is blue." to %T12% Variable Modify String: Append %T1% to %T12% Variable Modify String: Append %T8% to %T12% Variable Modify String: Save %T12% to Clipboard <REM2:Based on your post, I will assume %T8% contains "The square" and %T12% contains "The balloon"><TVAR2:08:01:The square><TVAR2:12:01:The balloon><REM2:First we create the CR/LF variable:><ASCIIC:1:1:13><ASCIIC:2:1:10><TMVAR2:08:01:02:000:000:><REM2:Now we can do what you were trying to do:><TMVAR2:07:08:00:000:000: is red.><TMVAR2:07:12:00:000:000: is blue.><TMVAR2:08:12:01:000:000:><TMVAR2:08:12:08:000:000:><TMVAR2:16:12:00:000:000:>
  2. I'm not Cory (he doesn't monitor the ME3 boards anymore, to my knowledge), so his method may differ from mine, but I might use features such as "Set Integer from position of text in Variable" to locate the To:, then use copy to clipboard starting at that Integer and copying over a specific number of characters from that point. You'll need some logic to determine the exact number of spaces, and you'll need to modify the original integer in order to prevent the "To:" from being copied as well, but that's the general idea. Something like this: Example email header: Example macro: Clipboard Copy Variable Set String %T1% from Clipboard Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% + 3 Variable Set Integer %N2% from Position of Text in Variable %T1% Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T2% Variable Modify String: Trim %T2% Text Box Display: Recipient <CLIPC><TVAR2:01:03:><IVAR2:01:13:1:To:><NMVAR:01:01:1:0000001:2:0000003><IVAR2:02:13:1:From:><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:02:01:N01:N03:><TMVAR2:01:02:00:000:000:><TBOX4:T:1:CenterCenter000278000200:000:Recipient%T2%> EDIT- If you read this earlier, I had posted the above code for ME Pro, not realizing I was on the ME3 board... I have now updated the code for ME3. Sorry for any confusion.
  3. Jason, I'm not sure if this is the same issue, but in recent builds of MEP the Paste functions when called by a macro (either clipboard paste, or Text Type: Use clipboard to paste), do not work 100% of the time. Closer to about 50%, if that. I've had to change all my TextTypes to "Simulate keystrokes" or build self-check repeat-loops to make sure the pasted info is actually pasting. It's a pain in the butt, and I originally attributed it to my PoS work-computer, but pasting works fine when done in ME3 or when I manually do Ctrl+V I have not ever reported it as an official bug, because I just don't know what info to give the folks at ISS, and because my MEP at home works 100% whenever I've built macros to test it. <shrug>
  4. Yes, that will work - I don't know what I was thinking when I said you can't do it. I guess what I meant was that there is no way to convert a text variable in the format 03/15/1980 into a date/time variable directly. What I believe you'll need to do is parse each segment into a different text variable, eg. %Mm%, %Day%, %Yr%; then convert each text variable into an integer or decimal and do whatever math needs to be done in order to create the date/time variable. Having thought about it a little today, I'm now sure that it can be done with some patience, but I don't know that I'll have a chance to figure it out today.
  5. Cory is probably the best person to ask for help with that particular aspect. He grasps the way dates are handled in MEP and Excel and has posted a number of times hints and suggestions on using the date features of MEP. Some of that might help you. I just have a hard time wrapping my head around date/time functions as decimals.
  6. Ok, this will do everything you specified, with the exception of calculating the patient's age. That kind of scripting is way too complex for me to try to do while working (and I'm not 100% convinced it's even possible with MEP right now). If it is, it's way beyond my comprehension at this point. Anyway, you'll obviously want to change the location of the source file (this macro points to a .txt file I saved to my desk top), and the location of the results file (again, I pointed it at my desk top. You'll make those changes on the Text File Begin Process command and on the very very last command: Variable Modify String Any other changes you may need to make for your specific needs will be between the "Begin Process" and "End Process" commands, more than likely. <COMMENT Value="Create a carriage return variable"/> <VARIABLE SET TO ASCII CHAR Value="13" Destination="%CRLF%"/> <VARIABLE SET TO ASCII CHAR Value="10" Destination="%T[1]%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%CRLF%" Variable="%T[1]%"/> <TEXT FILE BEGIN PROCESS Filename="C:\\Documents and Settings\\z051940\\Desktop\\medrecord.txt" Start_Record="1" Process_All="TRUE" Records="1" Variable="%FileProcess[1]%"/> <IF VARIABLE Variable="%FileProcess[1]%" Condition="\x06" Value="Person" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%FileProcess[1]%" ToReplace="Person: " All="FALSE" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%FileProcess[1]%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%FileProcess[1]%%CRLF%"/> <END IF/> <IF VARIABLE Variable="%FileProcess[1]%" Condition="\x06" Value="MRN" IgnoreCase="FALSE"/> <COMMENT Value="Set MRN"/> <VARIABLE SET INTEGER Option="\x0E" Destination="%Position[1]%" Text_Variable="%FileProcess[1]%" Text=" MRN" Ignore_Case="FALSE"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%FileProcess[1]%" Start="1" Count="%Position[1]%"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%FileProcess[1]%" ToReplace="MRN:" All="FALSE" IgnoreCase="FALSE"/> <VARIABLE SET INTEGER Option="\x0E" Destination="%Position[2]%" Text_Variable="%FileProcess[1]%" Text=" DOB" Ignore_Case="FALSE"/> <VARIABLE MODIFY STRING Option="\x09" Destination="%MRN%" Variable="%FileProcess[1]%" Start="1" Count="%Position[2]%"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%MRN%"/> <COMMENT Value="Set DOB"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%FileProcess[1]%" Start="1" Count="%Position[2]%"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%FileProcess[1]%" ToReplace="DOB:" All="FALSE" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%FileProcess[1]%"/> <VARIABLE MODIFY STRING Option="\x09" Destination="%DOB%" Variable="%FileProcess[1]%" Start="1" Count="10"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%DOB%"/> <COMMENT Value="Set Gender"/> <VARIABLE SET INTEGER Option="\x0E" Destination="%Position[3]%" Text_Variable="%FileProcess[1]%" Text=" Gender" Ignore_Case="FALSE"/> <VARIABLE MODIFY STRING Option="\x0A" Destination="%FileProcess[1]%" Start="1" Count="%Position[3]%"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%FileProcess[1]%" ToReplace="Gender:" All="FALSE" IgnoreCase="FALSE"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%FileProcess[1]%"/> <VARIABLE SET STRING Option="\x00" Destination="%Gender%" Value="%FileProcess[1]%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%MRN%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%CRLF%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%DOB%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%CRLF%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%Gender%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%CRLF%"/> <VARIABLE MODIFY STRING Option="\x07" Destination="%NewMedRecord%" Variable="%CRLF%"/> <END IF/> <TEXT FILE END PROCESS/> <VARIABLE MODIFY STRING Option="\x11" Destination="%NewMedRecord%" Filename="C:\\Documents and Settings\\z051940\\Desktop\\New Medical Record.txt" CRLF="FALSE"/> It will look something like this, in the script editor: // Create a carriage return variable Variable Set to ASCII Char 13 to %CRLF% Variable Set to ASCII Char 10 to %T[1]% Variable Modify String %CRLF%: Append Text String Variable (%T[1]%) Text File Begin Process: C:\Documents and Settings\z051940\Desktop\medrecord.txt If Variable %FileProcess[1]% Contains "Person" Variable Modify String: Replace "Person: " in %FileProcess[1]% with "" Variable Modify String %FileProcess[1]%: Trim Variable Modify String %NewMedRecord%: Append Text String Variable (%FileProcess[1]%%CRLF%) End If If Variable %FileProcess[1]% Contains "MRN" // Set MRN Variable Set Integer %Position[1]% to the position of " MRN" in %FileProcess[1]% Variable Modify String %FileProcess[1]%: Delete a substring starting at 1 and %Position[1]% characters long Variable Modify String: Replace "MRN:" in %FileProcess[1]% with "" Variable Set Integer %Position[2]% to the position of " DOB" in %FileProcess[1]% Variable Modify String: Copy a substring in %FileProcess[1]%, starting at 1 and %Position[2]% characters long to %MRN% Variable Modify String %MRN%: Trim // Set DOB Variable Modify String %FileProcess[1]%: Delete a substring starting at 1 and %Position[2]% characters long Variable Modify String: Replace "DOB:" in %FileProcess[1]% with "" Variable Modify String %FileProcess[1]%: Trim Variable Modify String: Copy a substring in %FileProcess[1]%, starting at 1 and 10 characters long to %DOB% Variable Modify String %DOB%: Trim // Set Gender Variable Set Integer %Position[3]% to the position of " Gender" in %FileProcess[1]% Variable Modify String %FileProcess[1]%: Delete a substring starting at 1 and %Position[3]% characters long Variable Modify String: Replace "Gender:" in %FileProcess[1]% with "" Variable Modify String %FileProcess[1]%: Trim Variable Set String %Gender% to "%FileProcess[1]%" Variable Modify String %NewMedRecord%: Append Text String Variable (%MRN%) Variable Modify String %NewMedRecord%: Append Text String Variable (%CRLF%) Variable Modify String %NewMedRecord%: Append Text String Variable (%DOB%) Variable Modify String %NewMedRecord%: Append Text String Variable (%CRLF%) Variable Modify String %NewMedRecord%: Append Text String Variable (%Gender%) Variable Modify String %NewMedRecord%: Append Text String Variable (%CRLF%) Variable Modify String %NewMedRecord%: Append Text String Variable (%CRLF%) End If Text File End Process Variable Modify String: Save %NewMedRecord% to "C:\Documents and Settings\z051940\Desktop\New Medical Record.txt"
  7. Most of this will be very simple to do using either a Text File Process command loop, or even a basic set of Copy/Delete Text File commands. The hardest part is going to be converting DOB to actual age. I'll take a stab at building a macro that does what I think you are trying to do. Even if mine isn't exact you ought to be able to extrapolate just exactly how to do it right based on picking my macro apart and... um... familiarizing yourself with the sample macros that come with Macro Express, as well as reading the help pages. Ahem. Hint-hint. Give me a while to work on it, though. I'm at work, and they prefer when I do what I get paid to do.
  8. This happens to me all the time. Honestly, I stopped considering it an ME problem and figured it was the fault of my PoS work PC. If other people are starting to experience it, maybe there is hope for my computer after all!
  9. I used to have the hanging Forrest in early versions of MEP, and it is back with the latest version, though I've only noticed it once. He didn't affect my work-flow or the functionality of my macros, though, so I ignored him. Until ME crashed. At that point I sent a bug report and relaunched the program. This was on Thursday or Friday, I believe, so it hasn't been a huge nightmare for me like some of the crashes I was getting on the last version.
  10. But what you can do is estimate how big your array is going to need to be, and then establish it larger than you expect to need, and then you should be fine. And by way of clarifying, you can use integer variables to manipulate the array within the macro itself. eg: %Stuff[%Integer[1]%]% If Integer[1] = 25, then this will establish or call variable %Stuff[25]%
  11. Good point! Let us know how it turns out. Something else you might want to do is enable logging of all commands (under the miscellaneous tab in the ME Editor). When the macro fails, you'll be able to pull up that log and see exactly what the last executed line of code was. That can be useful to help catch the faulty command, whether it's the script or some bug within ME itself. Of course, if this macro is running thousands of times in a row, you might want to work something into the macro that deletes the file every so often. Kevin once told me that when that file gets really big, it can adversely affect the macro being logged. Also, errors will often tell you what line broke the macro, but I'm sure you probably already caught that.
  12. A few quick observations that may or may not be useful (depending on what the "calling macro" contains). The "Undefined Variable" error I used to get all the time when I had Save and Restore variable commands in use. I stopped using them, and stopped getting that error. Your "If variable is greater than/Goto" sequence seems redundant, since the random value being generated will never be greater than 99999 (as per the Set Integer command). Though I don't see how this would negatively affect the macro, it just seems unnecessary. Your "If Variable is less than" sequences are excessive. The way you have it built, you really only need the one "If less than 10000". No matter what, if it's less than 10, 100, 1000, then it's also less than 10000, and you only need to have one command sequence to establish the 6-digit padding. Again, the extra commands probably aren't going to affect the outcome of the macro, but streamlining can make things easier to trouble-shoot. As it is, I don't see any obvious reason for the macro to be failing or erring. Perhaps with the other macros involved, we may be able to see something you could have missed.
  13. Assuming I understood what you wanted, the answer was not too difficult to figure out. As I mentioned, it did require a little bit of extra logic which, in turn, required quite a few extra lines of code, but nothing too extreme. The following code makes several assumptions about the text you'll be modifying with it. 1. It assumes the wildcards will always fall after style id=" or script id=' 2. It assumes that script id=' will always be followed by title= and 3. It assumes that style id=" will always be followed by name= Where you see N1 modified by +11 and +10, those numbers are derived by the number of characters of script id=' and style id=", respectively. Finally, because the original request to change <subtitle_script id='47166' to [script Info]^p and <style id="49922" name=" to Style: The Replace commands completely removed the "wildcards", leaving there no reason to even care about them... so in order to be thorough (I like thoroughness), I went ahead and added them back in so the results should end up looking like this: <subtitle_script id='47166' to [script Info]^p 47166 and <style id="49922" name=" to Style: 49922 Here's the code. Let us know if you're still having issues (though we really might want to move it over to the ME3 forum). <REM2:use text file in installationPath "textanswers.txt"><TVAR2:05:04:C:\Documents and Settings\z051940\Desktop\sample.txt><REM2:The following code will isolate the "script id" wildcards><IVAR2:01:13:5:script id='><NMVAR:01:01:1:0000001:2:0000011><IVAR2:02:13:5:title='><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:06:05:N01:N03:><TMVAR2:21:06:01:001:000:'><TMVAR2:01:06:00:000:000:><REM2:The following code will isolate the "style id" wildcards><IVAR2:01:13:5:style id="><NMVAR:01:01:1:0000001:2:0000010><IVAR2:02:13:5:name="><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:07:05:N01:N03:><TMVAR2:21:07:01:001:000:"><TMVAR2:01:07:00:000:000:><REM2:Do all your replaces here; this only example><TMVAR2:21:05:01:001:000:<subtitle_script id='%T6%'[Script info]^p %T6%><TMVAR2:21:05:01:001:000:<style id="%T7%" name="Style: %T7%><DELAY:1><REM2:....all numbers, descending, in between; there's probably a better way...><TMVAR2:17:05:00:000:000:C:\Documents and Settings\z051940\Desktop\sample2.txtT>
  14. Hmmm... Make sure your "Replace" commands don't have any spaces before or after the text you want changed. That is the number one problem I have when using this particular command. Those invisible spaces will throw a monkey wrench into the gears, making a mess of an otherwise perfect macro. If that doesn't work, try my code (it's virtually identical to yours). My sample.txt is on my desktop, so you'll want to either change the directory in the macro, or put your sample.txt on your desktop. <REM2:use text file in installationPath "textanswers.txt"><TVAR2:05:04:C:\Documents and Settings\z051940\Desktop\sample.txt><REM2:Do all your replaces here; this only example><TMVAR2:21:05:01:001:000:<subtitle_script id='47166'[Script info]^p><TMVAR2:21:05:01:001:000:<style id="49922" name="Style:><DELAY:1><REM2:....all numbers, descending, in between; there's probably a better way...><TMVAR2:17:05:00:000:000:C:\Documents and Settings\z051940\Desktop\sample2.txtT> As far as the wildcard issue goes, I have to say I'm not completely certain what it is you need to do. Are you calling it a wildcard because it will be different each time the macro runs, and you need the macro to recognize the text that needs to change regardless of what numbers are inside it? If so, it is possible, though it will take a bit more logical code to make the macro work. I'll take a shot at it and post my results when I have them (at work right now, so it may take a little while).
  15. I put the names "John Wilkes Booth" in cells A1, B1, and C1 respectively. I highlighted them all, then did a Ctrl+C copy. At that point I ran this macro: <VARIABLE SET TO ASCII CHAR Value="9" Destination="%Tab%"/> <VARIABLE SET STRING Option="\x02" Destination="%T[1]%"/> <SPLIT STRING Source="%T[1]%" SplitChar="%Tab%" Dest="Names" Index="1"/> <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %Names[1]%\r\n\\par %Names[2]%\r\n\\par %Names[3]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="1" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> This appears to do the trick.
  16. I second that. Of course, the macro I built above removes them automatically (unless you want them removed from the "some text" section).
  17. Is it just me, or did the entire forum just forget who had already read all the posts in any given topic? It's not a big issue, but I do like to keep the little brief cases gray as much as possible. Makes me feel like I've done my part by reading everything everybody has written. Anybody else?
  18. First, I have to ask: What version of Macro Express are you using? Your code above looks like Macro Express 3, but this is the Macro Express Pro forum. The help you're looking for is likely going to be different depending on which version you're using.. Second, I see you set the installation path to T4, but then you don't do anything with T4. You then set T5 from sample.txt, but we don't know what sample.txt contains (I'm assuming it contains the information from the first "code box" in your post. If that is the case, I don't see any reason why this macro wouldn't be replacing the text you've specified. I just ran the macro (after changing the sample.txt and sample2.txt locations to my desktop for my convenience). Here are my results, before and after: Before After btw, I did this in ME3, based on the code provided. Edit - Time: 8:07 Mtn In the interest of being thorough, I modified the macro to perform exactly the changes you asked specifically about. The macro had no trouble making these changes: <subtitle_script id='47166' was changed to [script Info]^p and <style id="49922" name=" was changed to Style: Well, that's not entirely true. There was a brief moment when the second one didn't work, but that was before I realized that the word "name" had already been changed to "apple", which led to a whole other confusion. Anyway, I disabled the command that changed "name" to "apple" and the macro worked fine. See examples of before and after below. The question remains: do you want name changed to apple? or do you want <style id="49922" name=" changed to Style:? Or do you want some other combination altogether? Before <subtitle_script id='47166' title='English' play_res_x='640' play_res_y='480' lang_code='enUS' lang_string='English (US)' created='2 days ago' progress_string='' status_string='Approved' wrap_style='2'><styles><style id="49922" name="PLACEHOLDERS" After [Script info]^p title='English' play_res_x='640' play_res_y='480' lang_code='enUS' lang_string='English (US)' created='2 days ago' progress_string='' status_string='Approved' wrap_style='2'><styles>Style:PLACEHOLDERS"
  19. I think part of what Cory is getting at is that this particular issue has been dealt with over and over ad nauseum on both the ME3 boards as well as ME Pro. Frankly, Excel is a bear to work with directly. It is generally easier to do like Cory suggests and copy the entire range of cells you're trying to manipulate and utilize functions like Text File Process and ASCII File Process commands (or, as he actually suggested, the Split String command).
  20. I'll help you figure it out, since I'm the one who just threw it in there without any explanations . Since I basically just did the same thing over and over and over, I'll just pick apart one section to help you see what I was doing, so you can modify it to suit your specific needs. // Collect income "xxxx" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% + 7 Variable Set Integer %N2% from Position of Text in Variable %T1% Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Variable Modify String: Append "#" to %T2% I hope this helps you out!
  21. There are a few different ways to do this. The way I'm going to show you is the longest, yet simplest, way. It's long because it treats each bit of information individually. There are more complex processes that you can use which result in a much shorter macro, but it is a bit more complicated logically. Since you're new to processing text, I felt it would be better to go with the simpler, if longer, approach. I used exactly your text from above to build this macro, however it should work fine if "Personname" is replaced by "Gary Strongmore" or if "(Department)" is replaced by "(Accounting)" - Note, however, it will not work without the parentheses. Because you put them in your text, I built the macro to rely upon them. If your clipboard text does NOT have those parentheses, you'll need to modify the logic, though I'm not in a position to instruct you in exactly what direction. Here it goes: <TVAR2:01:03:><REM2:Collect "Personname"><IVAR2:01:13:1:(><NMVAR:02:01:1:0000001:2:0000001><TMVAR2:10:02:01:001:N01:><TMVAR2:01:02:00:000:000:><TMVAR2:07:02:00:000:000:#><REM2:Collect "(Department)"><IVAR2:02:13:1:)><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:03:01:N01:N03:><TMVAR2:21:03:00:000:000:(><TMVAR2:01:03:00:000:000:><TMVAR2:08:02:03:000:000:><TMVAR2:07:02:00:000:000:#><REM2:Collect income "xxxx"><IVAR2:01:13:1:Income:><NMVAR:01:01:1:0000001:2:0000007><IVAR2:02:13:1:Entrydate><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:03:01:N01:N03:><TMVAR2:01:03:00:000:000:><TMVAR2:08:02:03:000:000:><TMVAR2:07:02:00:000:000:#><REM2:Collect entrydate "xx.xx.xxxx"><IVAR2:01:13:1:Entrydate:><NMVAR:01:01:1:0000001:2:0000010><IVAR2:02:13:1:Sex><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:03:01:N01:N03:><TMVAR2:01:03:00:000:000:><TMVAR2:08:02:03:000:000:><TMVAR2:07:02:00:000:000:#><REM2:Collect sex: "xxx"><IVAR2:01:13:1:Sex:><NMVAR:01:01:1:0000001:2:0000004><IVAR2:02:13:1:Age><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:03:01:N01:N03:><TMVAR2:01:03:00:000:000:><TMVAR2:08:02:03:000:000:><TMVAR2:07:02:00:000:000:#><REM2:Collect age "xx"><IVAR2:01:13:1:Age:><NMVAR:01:01:1:0000001:2:0000004><NMVAR:01:02:1:0000001:2:0000007><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:03:01:N01:N03:><TMVAR2:01:03:00:000:000:><TMVAR2:08:02:03:000:000:><TMVAR2:07:02:00:000:000:#><REM2:Attach the "some text"><IVAR2:01:12:1><NMVAR:02:03:1:0000001:1:0000002><TMVAR2:10:03:01:N02:N03:><TMVAR2:01:03:00:000:000:><TMVAR2:08:02:03:000:000:><TBOX4:T:1:CenterCenter000278000200:000:T2%T2%> In the Script Editor it will look something like this: Variable Set String %T1% from Clipboard // Collect "Personname" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% - 1 Variable Modify String: Copy Part of %T1% to %T2% Variable Modify String: Trim %T2% Variable Modify String: Append "#" to %T2% // Collect "(Department)" Variable Set Integer %N2% from Position of Text in Variable %T1% Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T3% Replace "(" with "" in %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Variable Modify String: Append "#" to %T2% // Collect income "xxxx" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% + 7 Variable Set Integer %N2% from Position of Text in Variable %T1% Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Variable Modify String: Append "#" to %T2% // Collect entrydate "xx.xx.xxxx" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% + 10 Variable Set Integer %N2% from Position of Text in Variable %T1% Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Variable Modify String: Append "#" to %T2% // Collect sex: "xxx" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% + 4 Variable Set Integer %N2% from Position of Text in Variable %T1% Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Variable Modify String: Append "#" to %T2% // Collect age "xx" Variable Set Integer %N1% from Position of Text in Variable %T1% Variable Modify Integer: %N1% = %N1% + 4 Variable Modify Integer: %N2% = %N1% + 7 Variable Modify Integer: %N3% = %N2% - %N1% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Variable Modify String: Append "#" to %T2% // Attach the "some text" Variable Set Integer %N1% from Length of Variable %T1% Variable Modify Integer: %N3% = %N1% - %N2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Trim %T3% Variable Modify String: Append %T3% to %T2% Text Box Display: T2
  22. Mostly confused by the question. Is your audio device an iPod? Zune? 8-track player? Because if so, then yeah, completely stumped, and pretty sure that ME can't affect those devices directly, even if they are hooked into the computer. If, on the other hand, you are simply referring to WinAmp, Windows Media player, etc., then yes, you can use MEP to manipulate those programs through the applications' own built-in hot-keys or through meticulously defined mouse-movements within the macro. Macro Express also has commands specifically designed for multimedia manipulation. They're under the "Multimedia" category of commands (shockingly). The commands range from Audio Balance, Mute, Beep, to MIDI Volume controls etc.. From my understanding these commands are very general, affecting the computer settings, rather than those of individual applications. I have personally never had any cause to use any of them other than the Beep command which I have used for diagnostic purposes only.
  23. Just a quick observation: You have a Mouse Left Click command after the window activates. If the mouse is hovering over a different window, that click will cause Excel to lose focus, thereby defeating the rest of the macro. I will now test your code for my own enjoyment. Edit Your macro doesn't do anything. At least it doesn't do anything like what you're trying to make it do. Let me explain what your macro is doing, because from there we can work out what to change to make it do what you want it to do. What I think you probably want to do is drop the Mouse Position commands, because they don't appear to do anything, as well as the Mouse Click command. As long as a cell is already selected, the following should work flawlessly: <WINDOW ACTIVATE Title="Microsoft Excel" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <TEXT TYPE Action="0" Text="<ENTER>"/> Yep, two lines: Window Activate: Microsoft Excel Text Type (Simulate Keystrokes): <ENTER>
  24. My experience has been that you cannot run a macro while that macro is running from a previous iteration. Just to test the theory I did what Cory suggested and built a little test macro. My suspicions were confirmed.
  25. Ok, scratch all that. The macro just lagged, the beep followed the lag. So I'm going to conclude that the lag is within the activation itself. I guess now I need to follow Kevin's third suggestion and contact Support.
×
×
  • Create New...