Jump to content
Macro Express Forums

patrickbarrett

Members
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

patrickbarrett's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Something like this should work as well: <VARIABLE SET TO ASCII CHAR Value="37" Destination="%PercentSign%"/> <VARIABLE SET STRING Option="\x00" Destination="%TextToEnter%" Value="cd %PercentSign%WINNT%PercentSign%"/>
  2. I have found that this is only an issue on Windows 7 SP1 when you remote in to the machine using a program like RDC, Bomgar or the like. But when accessed locally the macro triggers work fine. If SP1 isn't loaded, macros also trigger fine on the remote machine.
  3. I am trying to see if there is a known issue with Macro Express 3.5.5.2 on a Windows 7 SP1 machine. My company currently uses Windows XP and we are slowly transitioning everyone over to Windows 7. Macro Express 3.5.5.2 is our current standard and we have plans to move to Macro Express 4.1.6.1 in the future. On XP and Windows 7 all macros work perfectly fine, but testing on multiple machines with Windows 7 SP1 all triggers have stopped working (both hotkey and shortkey, although scheduled ones seem to kick off fine). Are there any known issues with the keystroke recording that Macro Express uses that could be causing this?
  4. Instead of adding delays after each one, I would suggest using the "Wait Text Playback" between Text Types that do different functions (moving between fields, changing a drop down, and typing out text) and before you move on to another function (like grabbing a Control) to make sure it has finished. I find that most applications receive the text type just fine, but if there is a lot of text it gets "queued up" or "stacked" and the type out hasn't finished before it moves on to the next step in the macro and the "Wait Text Playback" is a great way to have it slow down just for that moment (instead of slowing down all of the text type outs using the keystroke speed). Example: Text Type: <CTRLD>b<CTRLU>NOTE<CTRLD>b<CTRLU>: Type out this text. Wait Text Playback Text Type: <TAB><SPACE> Wait Text Playback Set Focus to %C2% NOTE: Some applications still don't play nice with this and keystroke speed is needed, but almost all of the ones I interact with work just fine just using "Wait Text Playback".
  5. I don't know of a way that you can figure out which text is italics, but if you know the range or the text you can always type it back out with italics via text type: <TEXTTYPE:Testing 123 <CTRLD>i<CTRLU>Testing<CTRLD>i<CTRLU>>
  6. Hello monpasdg, Yes you can use something like this to go through multiple Controls: Get Control %C1% If Not Control %C1% Enabled Get Control %C1% End If If Not Control %C1% Enabled Get Control %C1% End If ... If Not Control %C1% Enabled Error Message If Nothing Found End If Or maybe use the other code I posted above in reply to Kevin.
  7. Thanks Kevin! That's a great idea. I had no clue I could use "Run Macro in Variable" in that way. I was thinking of using it more like this: Repeat Until %T2% = "ANYTHING" Variable Modify Integer: %N1% = %N1% + 1 Variable Set String %T2% "<GETCONTROL2:01:JAVAW.EXE:SWT_Window0\sWindowHeaderHere\s012:19\sSWT_Window0\s1\sSWT_Window0\s3\sSWT_Window0\s%N1%\sSWT_Window0\s1\sSWT_Window0\s2\sSWT_Window0\s5\sSWT_Window0\s4\sSWT_Window0\s1\sSWT_Window0\s6\sSWT_Window0\s1\sSWT_Window0\s2\sEdit\s>" Run Macro in Variable %T2% If Control %C1% Enabled Repeat Exit End If Repeat End Variable Get Control Text: %C1% to %T1% NOTE: I replaced "" with "/s" for the separator character in the Get Control. "<GETCONTROL2:01:JAVAW.EXE:SWT_Window0\sWindowHeaderHere\s012:19\sSWT_Window0\s1\sSWT_Window0\s3\sSWT_Window0\s%N1%\sSWT_Window0\s1\sSWT_Window0\s2\sSWT_Window0\s5\sSWT_Window0\s4\sSWT_Window0\s1\sSWT_Window0\s6\sSWT_Window0\s1\sSWT_Window0\s2\sEdit\s>" So if you know which ID is changing in the Control, you can loop through until the one currently active is found and then exit the loop and move on with the macro. Although I did get this to work, just not in the situation I'm working on at the moment, as the application is changing two IDs in the Control and if you have multiple windows open, some times the Control is there, just not in the active window. I'll have to do more testing to see if I can get around this (I tried using "Variable Modify Control %C1%: Modify Top-Level Window Title") to no avail. As for: Yes, I've used that method for years to get controls in other applications, but it doesn't work properly with this new application. It seems that depending on the number of tabs open and the order of the tabs in the application the Controls change. When I use this method, it works sometimes, but if I re-order the Tabs or open a new one the Controls shift and the ones I'm searching for are there, just not in the active window. -Patrick
  8. Ward, Many times an application will have more than one Control for a given field. In general this is because of some sort of caching of the forms the application is doing. So maybe sometimes a macro works and other times it does. What you can do is multiple "Get Controls" like the following example: <LOGERR:N> <IFOTH:04:2:InfoWeb> <ACTIVATE2:InfoWeb> <ENDIF> <PAUSE2:000015,000015No message.T> <TEXTTYPECT:2:d> <WAITPB> <TEXTTYPE:<TAB>> <WAITPB> <GETCONTROL2:01:ÄD :WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3> <IFCONTROL:06:01> <GETCONTROL2:01:ÄD :WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3> <ENDIF> <IFCONTROL:06:01><GETCONTROL2:01:ÄD :WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3> <ENDIF> <VARGETCONT:1:1> <TBOX4:T:4:CenterCenter000278000200:000:TESTT1 = %T1%> <MSTOP> So you "Get Control", then "If Not Control Enabled" you grab the second Control, and so on and so on for as many as you find. To figure out what is changing in the Control, I run the macro over and over until it fails (on my machine as well as others) and then duplicate the If/Get/End If and capture the Control that just failed (which should be different from the previous ones).
  9. Hello all, I'm running ME 3.5.5.2 and I use Control extensively in multiple applications. My company is moving to a new program here shortly and I am having a few issues translating our current macros over to it. It seems that the Controls that change depending on the number of windows you have open is very random, where as other applications tend to have a select few it cycles through (like MS Outlook and the Controls for a Subject line). I'm trying to see if there is a way to place a variable in the Control Details, so I can programmatically search for the correct Control in current window. Here is an example Control I have: - AppName.Exe - %T99% - [sWT_Window0] - SWT_Window0 - [index: 19] - SWT_Window0 - [index: 1] - SWT_Window0 - [index: 3] - SWT_Window0 - [index: 13] - SWT_Window0 - [index: 1] - SWT_Window0 - [index: 2] - SWT_Window0 - [index: 5] - SWT_Window0 - [index: 4] - SWT_Window0 - [index: 1] - SWT_Window0 - [index: 6] - SWT_Window0 - [index: 1] - Edit - [index: 2] Where %T99% is the Window Header name (that I grab at the beginning of the macro, to make sure I always stick to the window the macro was triggered on and not other windows that might be open). I'd like to do something like this: - AppName.Exe - %T99% - [sWT_Window0] - SWT_Window0 - [index: 19] - SWT_Window0 - [index: 1] - SWT_Window0 - [index: 3] - SWT_Window0 - [index: %N10%] - SWT_Window0 - [index: 1] - SWT_Window0 - [index: 2] - SWT_Window0 - [index: 5] - SWT_Window0 - [index: 4] - SWT_Window0 - [index: 1] - SWT_Window0 - [index: 6] - SWT_Window0 - [index: 1] - Edit - [index: 2] So I could loop through until I found the correct control. If this isn't possible in 3.5.5.2, can you do this in ME Pro?
  10. I was thinking about that as well... Or maybe just compile the AutoIT script as an EXE and then have Macro Express call it when need be, pass the info to the clipboard via the script and then have Macro Express pull it in to a variable and parse. I did some testing with AutoIT to try this out, and I run in to the same issue. In AutoIT it just shows in more detail how the Handle, ID and Instance all randomly change depending on how many tabs are open and the order they are in. So I still can't figure out how to make AutoIT grab even one field's data consistantly. This is really killing me! There has to be SOME way of grabbing on to a field in Macro Express or AutoIT without using a Handle, Instance, or ID... Anyone have any other suggestions that have worked for them???
  11. Hi John, I've used AutoIT a little bit before but there are two issues I'd have with it. 1) I design a large set of macros for about 300 people (so I have to take in to account multiple configurations, set ups, etc.) and adding another program to the mix would be one hell of a headache. 2) The type of business I work for is highly regulated and open source software like AutoIT are not normally approved for use in the environment. Thanks for the input though!
  12. I've run in to this as well... You also can't tell it to wait for the Excel file to open as it won't "see" it as open until the Security Warning is taken care of. So instead of trying to find the button, I just told it to wait for the average amount of time it takes for that Security Warning to popup and then hit Alt+E <ALTD>e<ALTU> Which is like clicking "Enabled". If the load times are random (for example, it's a large file on a network share), you could have it do an Alt+E, delay for a moment, then test if the Excel window is on top. If on top, exit the loop, otherwise press Alt+E again, wait, check again and so on...
  13. Running ME 3.5.5.2 on XP and having an issue with Controls with the program: "HP Service Manager" AKA HPSM (the locally installed client, not the web client). I've been using ME for three years now and have been very successful with the use of Controls in various applications. In general, most applications have two or more controls for a given field, button, etc., and working with Cory a few years ago I can up with a handy little way of taking all of those different controls in to account by using: (see: http://pgmacros.invisionzone.com/index.php...amp;#entry10965) Get Control C1 (1) If NOT Control C1 Enabled Get Control C1 (2) End If Various ticketing programs, websites, Outlook, Excel, to name a few, all have worked using this method. But HPSM has been giving me trouble as a given Control's Indexing changes depending on how many tickets are currently open in the client, what position they are in, and what order they are in (they are each their own tab within the same parent window). For example: if you have three tickets open and close the one on the far right, the Control Indexes for the one that is NOW on the far right (which was previously second from the right) change to the base (1st) index and all of the other change. Far Right Window: JAVAW.EXE HP Service Manager - [sWT_Window0] SWT_Window0 - [index 19] SWT_Window0 - [index 1] SWT_Window0 - [index 1] SWT_Window0 - [index 1] SWT_Window0 - [index 1] SWT_Window0 - [index 2] SWT_Window0 - [index 5] SWT_Window0 - [index 1] Second from the right: JAVAW.EXE HP Service Manager - [sWT_Window0] SWT_Window0 - [index 19] SWT_Window0 - [index 1] SWT_Window0 - [index 1] SWT_Window0 - [index 137] SWT_Window0 - [index 1] SWT_Window0 - [index 2] SWT_Window0 - [index 5] SWT_Window0 - [index 1] No matter what field, button, etc. I am trying to capture a control for, the fourth Index changes depending on how many are open (but the number it starts at is different each time: 137, 14, 28, 39). I've tried using Capture Control to grab the Control during playback of the macro, but have not been able to get that to work but in a very few instances. What I'd LIKE to do, it either leave it a wildcard so it will find the control based on all of the other Indexes, or possible use a variable in that Index number and loop through changing that number until it finds the correct Index. If anyone can help me accomplish this, or possible point me in another direction, I'd greatly appreciate it!
  14. Here is an example of different ways of capturing multiple controls and programming a macro to take them in to account: http://pgmacros.invisionzone.com/index.php...amp;#entry10965 The problem is that many programs (Microsoft products are a good example) use cache in one form or another, have rolling controls, etc., and they don't write their programs with macros in mind (I recommend turning off Macro Express caching and if your program does a lot of caching but you don't really need it to, turn those options off). You can get around this by using the "If Not Control Enabled / End If" and just capture each control when it changes on you... Eventually you should have all of them and the macro will work consistantly. For example, many HP programs have two controls for every field in their forms; whereas Outlook e-mails can have dozens of controls based on the configuration of the client (HTML, Rich Text, Word as the Editor) so you have to take all of those in to account.
  15. You might have an easier time using VBA, which is built in to Outlook... Here are examples of macros you could place in an Outlook module (Tools\Macros\Visual Basic Editor): VBA CODE: Sub SlidesTrainingABC() Dim myOlApp As New Outlook.Application Dim myItem As Outlook.MailItem Dim myAttachments As Outlook.Attachments Set myItem = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem.Recipients.Add("Smith, John") myItem.Subject = "Slides Training ABC" Set myAttachments = myItem.Attachments myAttachments.Add "D:\Data\SlidesABC.pdf", _ olByValue, 1, "SlidesABC" myAttachments.Add "D:\Data\Evaluation.doc", _ olByValue, 1, "Evaluation" myItem.Display End Sub Sub SlidesTrainingXYZ() Dim myOlApp As New Outlook.Application Dim myItem As Outlook.MailItem Dim myAttachments As Outlook.Attachments Set myItem = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem.Recipients.Add("Smith, John") myItem.Subject = "Slides Training XYZ" Set myAttachments = myItem.Attachments myAttachments.Add "D:\Data\SlidesXYZ.pdf", _ olByValue, 1, "SlidesXYZ" myAttachments.Add "D:\Data\Evaluation.doc", _ olByValue, 1, "Evaluation" myItem.Display End Sub Then you could add shortcut buttons to your Outlook tool bar like this: Tools\Customize : Commands Tab Categories: Macros Drag and drop each macro to the toolbar. You can then right-click on it and change the name, icon, etc... If not, you could try doing something like this with ME: <MENU2:2:T:51:CenterCenter:Send Report:Which report would you like to send?Slides Training ABC Slides Training XYZ><REM2:Based on which select you picked, that Outlook Template is opened later on><IFVAR2:1:51:1:A><REM2:Set T50 to "Slides_Training_ABC.oft"><TVAR2:50:01:C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\Slides_Training_ABC.oft><ENDIF><IFVAR2:1:51:1:B><REM2:Set T50 to "Slides_Training_XYZ.oft"><TVAR2:50:01:C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\Slides_Training_XYZ.oft><ENDIF><LAUNCHDEL2:0:01%T50%><REM2:Attach file(s)> Just create two Outlook e-mail templates and place them in the standard template location. Then ME will prompt you for which one you'd like to open... you'll just need to add the code to attach the files. Hope that helps!
×
×
  • Create New...