terrypin
-
Posts
2,232 -
Joined
-
Last visited
-
Days Won
23
Content Type
Profiles
Forums
Events
Posts posted by terrypin
-
-
Scasper,
I was interested in your macro approach which uses a command I've never used myself before, Move Mouse to Tray Icon: "Macro Express". But I'm getting very erratic results with it. I had it working inconsistently for a while earlier, but now I've tried a dozen times in succession and get 'The system tray icon, "Macro Express", could not be located' every time. After that I noticed that r-clicking the MX system tray icon no longer displayed a menu. So I closed MX via XP Task Manager and re-started it. Now I have the r-click menu back, but the macro still fails with that message. Also, while the message is displayed, I note that the system tray icon has disappeared and a minimised tab for tne MX macro has appeared in my taskbar. When I abort the macro, the sys tray icon returns.
Any ideas on what might be happening here please?
--
Terry, East Grinstead, UK
-
This has had me puzzled for a while so I wonder if someone can explain it please. As part of another exercise, I'm experimenting with the following very trivial macro, which simply activates Notepad, maximises it, and pops up a message.
// Activate NotePad (already running) Activate Window: "Notepad" Wait For Window Title: "Notepad" Window Maximize: "Notepad" Text Box Display: Macro Return
The actual code is:
<REM2:Activate NotePad (already running)><ACTIVATE2:Notepad><WAITWIN2:000010:000000:Notepad><WMAX:Notepad><TBOX4:T:4:CenterCenter000278000200:005:Notepad has been opened and maximised><MRETURN>
Note how I've entered just the partial name 'Notepad', not the full name 'Untitled - Notepad'. Now, if I run that from the script editor it fails to work properly. The message pops up OK, but Notepad has not been maximised. Yet if I change that command to
Window Maximize: "Untitled - Notepad"
it does work correctly. And if I activate from a hotkey instead of from the Scripting editor, either version works fine.
Is there some obscure/undocumented issue at work here please?
--
Terry, East Grinstead, UK
-
Why use Get Pixel? In fact, I don't see how you could do it by that method.
As I understand it, you want to copy a rectangular section of the screen and make that a new image in Paint, yes? So why not do it as you would do it manually, namely
1. Capture to clipboard with a screen capture program (or the Prt Scr key)
2. Open Paint
3. Paste.
Use the known co-ordinates of the target rectangle with Mouse Move and dragging commands to specify it before your capture, if using aprogram like Snagit. Or do that afterwards in Paint if you've captured the whole screen with Prt Scr, and paste that extract to a new file.
--
Terry, East Grinstead, UK
-
I've successfully used the Mouse Left Button Down/Up commands before in various ways, but I'm stumped as to why this present little macro doesn't work. I'm simply trying to drag an entry in a list from one place to another, with familiar code like this:
Mouse Move Screen %N3%, %N4% Delay 200 Milliseconds Mouse Left Button Down Delay 200 Milliseconds Mouse Move Screen %N1%, %N2% Delay 100 Milliseconds Mouse Left Button Up Delay 300 Milliseconds
But it acts as if the mouse button has just been clicked, not kept down, so no dragging occurs.
Maybe it's a quirk of the application itself, so if anyone has Google Earth and likes a puzzle...
(Just try to drag an item in My Places.)
--
Terry, East Grinstead, UK
-
The menu is sorted by macro creation date. The first macro written and saved is the first one listed in the menu. The newest macro is added to the end of the list.
Unfortunately there is not a way to sort this list.
OK, thanks Stan, got it.
I'd suspected that was the order, but it didn't seem to match what I saw. But prompted by your post I've checked an example more methodically and it does indeed square with date of creation. What had thrown me was that I have a fair number of macros scoped to several programs and windows. Viewed in scope order and searching for a specific application, I didn't see some of these until I widened the window and scope column.
It's a neat tool, but pity it can't be hacked to alphabetic.
--
Terry, East Grinstead, UK
-
Click in the title line. You can sort ascending or descending by name, activation, scope, modified date....
Thanks but I think perhaps you misunderstood? I'm talking about the system macro, "...the built-in Menu of Macros for Topmost Window", which is invoked by Ctl+Shift+Alt+z. Its menu is apparently built automatically, so it's not accessible in Macro Explorer as your solution seems to imply. As far as I can see its sequence seems fixed and follows no logic I can detect!
--
Terry, East Grinstead, UK
-
There are several sites that will display your 'internet IP' (as opposed to your 'computer IP', which is what the MX command Get IP delivers). For example:
http://www.lawrencegoetz.com/programs/ipinfo/
http://www.computerhope.com/cgi-bin/systeminfo.cgi
Using that last one you can get your IP into T99 with this short macro, and it doesn't appear to create a CR/LF in T99:
// Get internet IP Web Site: [url="http://www.liveipmap.com/"]http://www.liveipmap.com/[/url] [Default Browser] Delay 2 Seconds Text Type: <TAB><TAB><TAB> Delay 100 Milliseconds Text Type: <CONTROL>c Variable Set String %T99% from Clipboard Delay 100 Milliseconds Text Box Display: Result Macro Return
If you want to use your existing code, try adding the command
Variable Modify String > Strip CR/LF
for T99
--
Terry, East Grinstead, UK
-
In a macro that I have produced I have put in the command to "get IP". the problem is that it gets the computer ip, a 192.168.1.1 address and not the actual IP from the internet.
Anyone have a suggestion on what I may be able to do?
Thanks in advance..
Frank
From Help:
"This command will find the IP (Internet Protocol) address of the computer running the macro and save this address to a Text String variable"
That sounds like exactly what it did, yes?
What are you trying to do?
--
Terry, East Grinstead, UK
-
Why do you keep opening new threads?
--
Terry, East Grinstead, UK
-
My apologies Terry. Your script works perfectly if I have a CRLF at the end of the 3rd line. When I was copying 3 lines of text to the clipboard I highlighted the 3 lines to copy, and of course the last line didn't contain CRLF. All's well now. Many thanks indeed.
P
Pleased to hear that!
-
Terry, that's really very kind of you to go to so much trouble. I appreciate it very much. As you can imagine I tried it straight away but unfortunately when I ran it, it just hung. Still, I'll study your script in detail and hopefully learn from it.
Maybe an example of what I'm hoping to do will help. I have 3 lines on the clipboard, such as:
Joe Bloggs
user.name@isp.com
This is some descriptive text
I want to convert it to:
<strong>Joe Bloggs</strong>
<a href="mailto:user.name@isp.com">user.name@isp.com</a>
<em>This is some descriptive text</em>
As you see in line 2, I've used the contents of that line twice, hence the reason I thought saving each line to a variable would be helpful to me.
I wrote a script to do the above in AutoHotKey, but I do so much text processing in MEX that I thought it would make sense to use MEX for this too.
Thanks again,
P
That's odd, it was working fine here. Your example would just need the 6 tags editing. Maybe there was some corruption during my cutting/pasting, or I screwed up the post somehow. Hope you manage to get it working. I'm packing in for the night here, but may have some time to look at it again tomorrow.
--
Terry, East Grinstead, UK
-
Many thanks Kevin. You've given me enough pointers to work through this myself and it will be an excellent learning exercise. I doubt I'd have been able to do it on my own.
P
The following is probably not the most elegant solution but it does the job:
// Add tags to 3 lines (for pepperpod) Text Box Display: Opening message Variable Set String %T1% from Clipboard // Set a variable for a CR (EOL) Variable Set %T2% to ASCII Char of 13 // Set variables for the 6 tags needed Variable Set String %T21% "[LINE1TAG1]" Variable Set String %T22% "[\LINE1TAG]" Variable Set String %T23% "[LINE2TAG]" Variable Set String %T24% "[\LINE2TAG]" Variable Set String %T25% "[LINE3TAG]" Variable Set String %T26% "[\LINE3TAG]" // Create Line 1 in T4 Variable Set String %T3% "" Variable Set Integer %N1% to 1 Variable Set String %T4% "" Repeat Until %T3% = %T2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Append %T3% to %T4% Variable Modify Integer: %N1% = %N1% + 1 Repeat End // Remove unwanted final CR from T4 Variable Modify String: Strip CR/LF from %T4% // Create Line 2 in T5 Variable Set String %T5% "" Variable Modify Integer: %N1% = %N1% + 1 Repeat Until %T3% = %T2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Append %T3% to %T5% Variable Modify Integer: %N1% = %N1% + 1 Repeat End // Remove unwanted final CR from T5 Variable Modify String: Strip CR/LF from %T5% // Create Line 3 in T6 Variable Set String %T6% "" Variable Modify Integer: %N1% = %N1% + 1 Repeat Until %T3% = %T2% Variable Modify String: Copy Part of %T1% to %T3% Variable Modify String: Append %T3% to %T6% Variable Modify Integer: %N1% = %N1% + 1 Repeat End // Remove unwanted final CR from T6 Variable Modify String: Strip CR/LF from %T6% // Add tags Variable Modify String: Append %T4% to %T21% Variable Modify String: Append %T22% to %T21% Variable Set String %T4% "%T21%" Variable Modify String: Append %T5% to %T23% Variable Modify String: Append %T24% to %T23% Variable Set String %T5% "%T23%" Variable Modify String: Append %T6% to %T25% Variable Modify String: Append %T26% to %T25% Variable Set String %T6% "%T25%" Text Box Display: Tagged values Delay 100 Milliseconds Macro Return
And here's the Direct Editor output if you're impatient to run it
<REM2:Add tags to 3 lines (for pepperpod)><TBOX4:T:4:000671Center000428000200:000:Opening messageThis assumes you already have 3 lines of text copied from somewhere onto the clipboard. If not, do so now. Click OK to run the macro.><TVAR2:01:03:><REM2:Set a variable for a CR (EOL)><ASCIIC:2:1:13><REM2:Set variables for the 6 tags needed><TVAR2:21:01:[LINE1TAG1]><TVAR2:22:01:[\LINE1TAG]><TVAR2:23:01:[LINE2TAG]><TVAR2:24:01:[\LINE2TAG]><TVAR2:25:01:[LINE3TAG]><TVAR2:26:01:[\LINE3TAG]><REM2:Create Line 1 in T4><TVAR2:03:01:><IVAR2:01:01:1><TVAR2:04:01:><REP3:08:000001:000001:0003:1:01:T2><TMVAR2:10:03:01:N01:001:><TMVAR2:08:04:03:000:000:><NMVAR:01:01:1:0000001:2:0000001><ENDREP><REM2:Remove unwanted final CR from T4><TMVAR2:04:04:00:000:000:><REM2:Create Line 2 in T5><TVAR2:05:01:><NMVAR:01:01:1:0000001:2:0000001><REP3:08:000001:000001:0003:1:01:T2><TMVAR2:10:03:01:N01:001:><TMVAR2:08:05:03:000:000:><NMVAR:01:01:1:0000001:2:0000001><ENDREP><REM2:Remove unwanted final CR from T5><TMVAR2:04:05:00:000:000:><REM2:Create Line 3 in T6><TVAR2:06:01:><NMVAR:01:01:1:0000001:2:0000001><REP3:08:000001:000001:0003:1:01:T2><TMVAR2:10:03:01:N01:001:><TMVAR2:08:06:03:000:000:><NMVAR:01:01:1:0000001:2:0000001><ENDREP><REM2:Remove unwanted final CR from T6><TMVAR2:04:06:00:000:000:><REM2:Add tags><TMVAR2:08:21:04:000:000:><TMVAR2:08:21:22:000:000:><TVAR2:04:01:%T21%><REM2:><TMVAR2:08:23:05:000:000:><TMVAR2:08:23:24:000:000:><TVAR2:05:01:%T23%><REM2:><TMVAR2:08:25:06:000:000:><TMVAR2:08:25:26:000:000:><TVAR2:06:01:%T25%><TBOX4:T:4:001039000863000565000242:000:Tagged valuesT1 = Original clipboard = %T1% T4 = Tagged Line 1 = %T4% T5 = Tagged Line 2 = %T5% T6 = Tagged Line 3 = %T6%><MSD:100><MRETURN>
Finally, here's an example of the output (in a message box):
T1 = Original clipboard =
Text line 1
A second line
And a third final line of text
T4 = Tagged Line 1 = [LINE1TAG1]Text line 1[\LINE1TAG]
T5 = Tagged Line 2 = [LINE2TAG]A second line[\LINE2TAG]
T6 = Tagged Line 3 = [LINE3TAG]And a third final line of text[\LINE3TAG]
--
Terry, East Grinstead, UK
-
I've just started trying the built-in Menu of Macros for Topmost Window but can't get any macro it builds to work. All fail on the very first command, with a message like this:
"Macro Express encountered an error while attempting to read the next macro command..."
Can others successfully use this important feature please? Is there a known problem with it?
---------
Pleased to report that upgrading from 3.7b to Version 3.7d build 1, 3.7.4.1 seems to have fixed this.
Is there any way to get more than 36 macros listed? Joe Weinpert in Macro Express Explained says on page 51 that this is possible, but I don't appear able to do it.
Also, what sequence are they in and can it be changed?
--
Terry, East Grinstead, UK
Another one sorted! I found that the total number scoped to the application (for which I was automatically building a menu) just happened to be 36. After increasing it, I did indeed get them all in the menu.
So that just leaves the question about the sequence.
--
Terry, East Grinstead, UK
-
I've just started trying the built-in Menu of Macros for Topmost Window but can't get any macro it builds to work. All fail on the very first command, with a message like this:
"Macro Express encountered an error while attempting to read the next macro command..."
Can others successfully use this important feature please? Is there a known problem with it?
---------
Pleased to report that upgrading from 3.7b to Version 3.7d build 1, 3.7.4.1 seems to have fixed this.
Is there any way to get more than 36 macros listed? Joe Weinpert in Macro Express Explained says on page 51 that this is possible, but I don't appear able to do it.
Also, what sequence are they in and can it be changed?
--
Terry, East Grinstead, UK
-
Great. The first thing to try is the Wait for Web Page command leaving the URL parameter blank. If that doesn't work then you may be able to use the Get Pixel Color to look for a specific color or colors on the page.
Kevin,
BTW, does that still work only for IE, or can I use it confidently in Firefox please?
--
Terry, East Grinstead, UK
-
Definately not a negative mass e-mail. There will be a number of e-mails sent, but, they are going to be sent to me.
OK Frank, here you go:
I first put an arbitrary 18 names into a file called NameList1.txt, and your 5 domain name into DomainList.txt
Here's the macro:
// Randomising email addresses (for frank1968)
// Ask how many entries are needed
Variable Set Integer %N9% from Prompt
Repeat with Variable using %N9%
// Get a random number between 1 and 18 to decide the Name T1
Variable Set Integer %N1% with a Random Number
// Get a random number between 1 and 99999 to decide the Number N2
Variable Set Integer %N2% with a Random Number
// Convert the integer to a string (so that it can be padded)
Variable Modify Integer: Convert %N2% to text string %T2%
// Pad it with leading blanks
Variable Modify String: Pad Left %T2%
Replace " " with "0" in %T2%
// Get a random number between 1 and 5 to decide the Domain T3
Variable Set Integer %N3% with a Random Number
Text File Begin Process: "NameList1.txt"
Text File End Process
Text File Begin Process: "DomainList.txt"
Text File End Process
// Activate the form (in this case a Notepad document)
Activate Window: "RandomEmailForFrank.txt - Notepad"
// Enter the first two line (Name & Number)
Text Type: %T1%<ENTER>
Text Type: %T2%<ENTER>
// Create the email adress and enter it as the third line
Variable Set String %T4% ""
Variable Modify String: Append "%T1%@%T3%" to %T4%
Text Type: %T4%<ENTER><ENTER>
// Repeat the loop again, until all the required entries have been made
Repeat End
Macro Return
Here's the direct code:
<REM2:Randomising email addresses (for frank1968)><REM2:Ask how many entries are needed><IVAR2:09:02:FHow many random entries do you want?FFCenter:Center><REP3:05:000001:000001:0009:0:01:><REM2:Get a random number between 1 and 18 to decide the Name T1><IVAR2:01:06:18><REM2:Get a random number between 1 and 99999 to decide the Number N2><IVAR2:02:06:99999><REM2:Convert the integer to a string (so that it can be padded)><NMVAR:05:02:0:0000002:0:0000000><REM2:Pad it with leading blanks><TMVAR2:14:02:00:005:000:><TMVAR2:21:02:01:000:000: 0><REM2:Get a random number between 1 and 5 to decide the Domain T3><IVAR2:03:06:5><BTFBEG:001:N00001:000001:C:\Docs\SUNDRY\Macro Express\NameList1.txt><BTFEND><BTFBEG:003:N00003:000001:C:\Docs\SUNDRY\Macro Express\DomainList.txt><BTFEND><REM2:Activate the form (in this case a Notepad document)><ACTIVATE2:RandomEmailForFrank.txt - Notepad><REM2:Enter the first two line (Name & Number)><TEXTTYPE:%T1%<ENTER>><TEXTTYPE:%T2%<ENTER>><REM2:Create the email adress and enter it as the third line><TVAR2:04:01:><TMVAR2:07:04:00:000:000:%T1%@%T3%><TEXTTYPE:%T4%<ENTER><ENTER>><REM2:Repeat the loop again, until all the required entries have been made><ENDREP><MRETURN>
And this is what the result looks like when I specified 10:
Peggy
92014
Peggy@three.com
Mary
46249
Mary@three.com
Elvis
82790
Elvis@two.com
David
60355
David@four.com
Buddy
02297
Buddy@three.com
Buddy
64823
Buddy@one.com
Jim
31594
Jim@one.com
Luke
85162
Luke@one.com
Peggy
55350
Peggy@three.com
David
38314
David@four.com
(Had to edit my first attempt as I'd padded with blanks instead of zeros. Looks OK now...)
I've been generous with Remarks, so you should be able to see what's happening and tailor it as you wish. Come back if you need any further help.
--
Terry, East Grinstead, UK
-
First, please reassure us! I do hope you're not a potential mass email spammer?
--
Terry, East Grinstead, UK
-
Is there something I should do to enable email notifications of post to a topic, beyond enabling them on the Post a new topic page and adding pgmacros.invisionzone.com to my whitelist, which I've done?
I thnk this should do what you want, Meg. After logging in, click My Controls (top right) and then click Options > Email and make the settings I've shown:
--
Terry, East Grinstead, UK
-
What timing! I just came to the forum to ask almost exactly the same question (in my case replacing with a comma plus a space) and found this as the second post from top. Thanks Stan
--
Terry, East Grinstead, UK
-
... BUT not any easy keyboard way to get to the URL line that I could find (unless you know a better way)
Nick,
As Stan mentioned, Alt+d seems to do it. Works for me in both Firefox and IE6.
--
Terry, East Grinstead, UK
-
The Macro Express commands read a the value from a registry key as long as you (your macro) knows the name of the key. The suggestion earlier in this thread to export the registry is a good way to get a list of unknown keys.
Thanks Kevin. I'll explore that. I was wondering if there might be a more direct way of somehow repeatedly reading through the registry values downwards from that first one.
--
Terry, East Grinstead, UK
-
Hi Cory,
Just been experimenting with this out of curiosity. The following commands
Read Registry String: "DisplayName"
Delay 100 Milliseconds
Text Box Display:
Macro Return
gets me the first entry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{00040409-78E1-11D2-B60F-006097C998E7}\DisplayName
But how would you iterate from there through the entire long list?
--
Terry, East Grinstead, UK
Anyone?
--
Terry, East Grinstead, UK
-
I don't agree with rberg. If you're only reading values from you're not going to do any harm and if you're writing your own keys to your own area you're not going go wrong. IOW just use some common sense. I use the registry as a handy place to pass variables between subroutines, set macro preferences and all kinds of things. But I do like rbergs suggestion because it solves a long time question I had and that is how to get registry keys if you don't know what they are in the first place. Good going!
You should be able to run it just like this: <LAUNCHDEL2:0:01regedit.exe<PARAM>/e c:\test.txt3> and schedule the macro to run at whatever interval you like. For things like these I like the "Time Out" scheduling option. This way it only runs when your machine is idle. Usually I pop up a little timed abort box JiC.
Hi Cory,
Just been experimenting with this out of curiosity. The following commands
Read Registry String: "DisplayName"
Delay 100 Milliseconds
Text Box Display:
Macro Return
gets me the first entry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{00040409-78E1-11D2-B60F-006097C998E7}\DisplayName
But how would you iterate from there through the entire long list?
--
Terry, East Grinstead, UK
-
Great, that sounds just the job. I haven't used that Text > Date/Time command before - I'll try it tomorrow.
--
Terry, East Grinstead, UK
The Problem For Random Time
in Macro Express 3.x
Posted
I think you will need to make a few modifications to your macro to get reliable operation. Here is my version:
And here is the code
ymnav:
Note that during testing I set N1 to a max of 3 minutes, not 100, so remember to change it to whatever you want.
Also, while I was composing this, the macro ran OK automatically a few times but just now gave an error because I had not excluded the possibility of a zero interval. So add the following directly after the random variable command:
// Ensure N1 is never 0
Variable Modify Integer: %N1% = %N1% + 1
Scasper: Re my previous post about the tray icon not working here, it all now seems OK. I think it may have been because of the Scroll Lock key being on, although that might be coincidence. Thanks a bunch for introducing me to the Move Mouse to Tray Icon command, which should prove very handy!
--
Terry, East Grinstead, UK