paul
-
Posts
1,049 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by paul
-
-
Keep your shirt on, Paul!
Shirt on!
You've now introduced a new term, 'stand-alone'. You appear to be saying that the condition 'Don't wait for m2 to terminate before proceeding [with m1]' really also means '...and don't allow m2 access to the variables previously defined with "Make this variable available to macros called by this macro" '.Is that the case? If so, all would become clear. IOW, does the absence of a checkmark against 'Wait for this macro to terminate before proceeding' mean it is what you are now calling a stand-alone macro, which has the very important property (not mentioned in the dialog) of not having access to variables defined in the calling macro? In direct contradiction to the variable settings?
Bingo! The "don't wait" setting indeed appears to mean that the called macro has no access to existing variables. Insight could certainly have used better wording for this, but there you are.
-
Using your example, Don't wait for m2 to terminate before proceeding [with m1] surely doesn't mean that m2 doesn't even start? And if it starts, then the variable should be available.
"m2 doesn't even start". Why on earth not? If m1 calls m2, of course m2 will start. The purpose of my example is to demonstrate exactly when m2 runs "stand-alone" (i.e. no variable values from the calling macro are available) and when it runs "as part of" m1 (all m1 variable values are available in m2). I thought is was pretty clear.
As I stated elsewhere, I suggested using F8 to run m1 simply to allow you to see m2's messages in the correct sequence. If you run m1 normally, the sequence of m2 messages may appear to be in the wrong order. I was merely trying to make it easier for you to understand. Apparently, I failed!
-
Anyway, why running the macro you attached gives different results while running it using F8 from running it the usual way?
Using F8 does not produce different results! In this case you need to use F8, otherwise you cannot distinguish between the two calls to m2, since m1 isn't waiting for m2 to finish in one of its calls. I could have inserted logic to handle that but didn't think it was worth the candle!
-
Hmm, on second thoughts, there's one more think I'd like to know. I am assuming that the variable T[1] is not accessible by the second macro, because macro 1 stops and it's variables cease to exist.
Wrong!
- By default, each macro defines 4 array variables of 99 elements called C, D, N and T which are available to called sub-macros. So both macro1 and macro2 "contain" these variables
- Because macro2 is independent (although it's called by macro1, macro1 does not wait for macro2 to complete), its variables come into existence only when it starts (whether as a result of you running it, or being called by macro1)
- If macro2 is called by, say macro3, where macro3 does wait for macro2 to complete, then in this instance macro2's variables first come into existence when macro3 starts and are therefore shared
Take a look at this example:
Macro m1
Variable Set String %T[1]% to "qwerty" Text Box Display: m1 (displays the value of %T[1]%) Macro Run: m2 (do not wait for m2 to terminate) Macro Run: m2 (wait for m2 to terminate)
Macro m2
Text Box Display: m2 (displays the value of %T[1]%)
Run m1 from the script editor using F8. You will see 3 text boxes containing the value of %T[1]%:
The first box shows qwerty
The second box shows blank
The third box shows qwerty
Do you follow?
-
Licensing, activation and all that are exactly as a real machine. The one exception is that W7 in effect comes with one free license for XP. However I've found that for older OS's I've always had spare license lying about from upgraded machines.
What about any licensing issues for Macro Express?
-
You just need to run MEP on that server. I do it all the time. Works fine. But if somehow you get MEP to work thru RD I'd be interested to know how.
In my former job I was using MEP and Remote Desktop all the time, and discovered odd behaviours I could never properly explain.
Here's an example:
MEP is running on both local and remote machines.
I have a macro that I want to run on the remote machine if that machine's window is active, otherwise run it on the local machine. It's activated on both machines by Ctrl-G. It determines whether the remote session is active (i.e. the foreground window); if no, then the macro processes locally in the normal way. If yes, then all the macro has to do is Type Ctrl-G, and, somehow, the remote machine's macro runs.
This technique works in 95% of key combinations, like Ctrl-G, but the key combinations cannot ever include the Windows key (having a macro type such a combination never invokes the remote macro, irrespective of what RDP settings are selected).
-
VM's (Virtual Machines) Are for all intent and purposes real machines that have their own IP addresses on the network and everything. I highly recommend any serious macro writer look into it.
Are there any licensing issues?
-
drive imaging is now a feature of the backup software so I don't need to pay Symantec more to update my copy of Ghost.
If using Windows 7's Backup utility, make very sure that you are able to restore from it. Unknown to me, Windows 7 scheduled a backup job to run weekly. My backup media is external and therefore not always available. When Windows 7 tried to run the scheduled backup, the external media drive was unavailable, and my entire backup catalog was corrupted, to the extent that the backup I had made earlier was useless.
-
Anyone able to reproduce and/or suggest an explanation please?
I get exactly the same result as you. CALC.EXE gives the error message while another .exe does not. And terminating Calculator using the window name also gives no error message.
-
I am having a problem splitting a string into two other strings. I found that if we have a short input string looking like this: "a.b" and we wanna split it at "." , "b" will not get saved. If we change the "b" to "bc" in the input string, it will work just fine, saving "a" to one string, and "bc" to another.
Can anyone confirm before I report it?
Agreed. It's exactly the sort of sloppy programming I'd have expected (not properly testing fringe conditions), so it's disappointing that I'm not disappointed!
-
But then again I think tabs are inefficient.
I'm fascinated to know why you find this so?
-
MEP produces -9.5 when asked to round -9.60000000000001 to a single decimal point. This answer is simply wrong - the correct response is -9.6.
You should report this as a bug.
-
You can use the Windows Task Scheduler to get down to the second. Actually there are many excellent benefits for using the built in Windows Scheduler. For instance you have more trigger and condition options like being able to run only if a certain amount of idle time has elapsed. Great for CPU or GUI intensive tasks you would like to run 'whenever' but not when you're trying to meet a deadline. But the coolest I think is being able to wake up the PC to perform the task because I like to sleep my PC when not in use to save power.
But you need to be aware that if you are logged out (i.e. you need to retype your password when the machine wakes), many/most macros will not run.
In which case, there is a separate technique that can be used, where the computer is automatically rebooted to login without having the user type a password, then runs the scheduled macro, then reverts the computer to requiring a user login, and finally returns to computer to its sleep/standby/hibernate status.
-
This rings so many alarm bells! I think you'll find that floating point operations (which I assume the Decimal variable is prone to) often result in these types of inexact results - I can remember similar problems in Microsoft Access and VB. If I'm right, then there's nothing Insight ca do for you.
For more information, see:
-
You can concert a string variable to decimal, then the decimal variable to date/time. Does this help?
-
I can think of arguments both ways:
- the argument in favour of not being allowed to run a disabled macro is self-evident
- but do you really want the action of disabling a macro to affect other macros that call it?
On balance, I think Insight has made the right decision (though it could just as easily be an oversght on their part!).
-
Yes, but in post # 9 I'm explaining that I thought that by the "Is it useful?" question he meant "Is the macro you have useful?". Now, what would give me the impression? The fact that the whole concept he provided above that question is the SAME concept my macro works at the moment. Plus he asked "Does this work as a concept [...]?. So I thought he was just describing my macro's concept to make sure he gets it right (because he didn't understand the way the macro works). So yes, his concept is right, I agree, but it's not different from the concept macro works on now. Nothing revelatory there.
One final contribution from me: I think your English is letting you down badly here. The point of outlining the concept to you was not to show you that I understood your concept, but to try and persuade you to think about your puzzle from a new angle. Nowhere in my outline is there any suggestion that you have to determine "all combinations within a set of elements"; indeed, it is this very notion that is causing you all your problems. Your insistence on calculating all combinations is exactly what is leading you astray.
I don't see the necessity or even possibility to rewrite the scriptIn which case I think you're on your own because you do not appear at all receptive to other suggestions.
You did not explain how to do it.This is why I prefixed my text with the words:
don't let's worry about the implementation at this stage -
I was referring to the macro usefulness itself, I don't see how this would resolve the problem mentioned in the topic.
My intention was to suggest an entirely different way of designing your macro(s) as I believe that the code you have written with the multiple nested Repeat loops has no chance of being visible (and therefore viable) in the way you want. In fact, display of this code has caused me several problems, some of which have caused ME to crash. So if my idea is useful (and you have indicated that it is), then I think you should abandon the approach you have adopted, and redesign and rewrite your macro using the logic I outlined.
-
Ah, a mah-jong player perhaps? Are you any good?
- Create an array of n rows by 200 integer columns (where n is the number of rows you will process).- Yes, however the array is stored as a string variable
Suppose a 2-row array of these values:
100 1000
21 8810
A numeric array will correctly sort these rows as
21 8810
100 1000
while a string array will produce the opposite.
Mind you, using Macro Express you can force all pixel values to be zero-filled to the left and 8-characters long, in which case strings will work fine.
For an outstanding sort utility, take a look at this:
(FYI I came across this utility in the early 1990s, and corresponded briefly with the author. A little while later the utility was published in a slightly different way - in fact, by his brother after the author's sudden and very untimely death.)
Is this useful?- Hell yes.
Does this mean you have sufficient information now to resolve your problem?
-
Does this work as a concept (don't let's worry about the implementation at this stage)?
- Create an array of n rows by 200 integer columns (where n is the number of rows you will process).
- Populate the array with the pixel values
- Sort the array
- Eliminate duplicates (do you need to remember eliminated line numbers?)
- Process the array to determine the smallest number of elements that render each line unique
- Create output
Is this useful?
-
I attach "code" that you should use to create a macro that finishes only when Firefox's toolbar X reverts to its normal loaded state (or after 100 iterations in case the site never loads). You'll probably have to change the pixel values in lines 8 and 12, and perhaps the location too in line 7.
You should be aware that in some circumstances Firefox is still not ready to continue even when the X has reverted. This explains the code from line 19 onwards: if the calling macro needs this macro to wait extra time, it specifies the number of seconds to wait in the allocated registry value. If you want to use this feature, you'll need to allocate a value at an appropriate location in the registry, and change the code in lines 19 and 23 to reflect that revised location.
If Not Program "FIREFOX.EXE" is running Macro Stop End If Window Activate: Mozilla Firefox // Check X, wait until not red Repeat Start (Repeat 100 times) Get Pixel Color at (140, 66) Relative to Current Window into %N99% If Variable %N99% Equals "13128728" Delay: 250 milliseconds Continue Else If Variable %N99% Equals "10791339" Repeat Exit End If End If Macro Stop End Repeat Delay: 1 seconds Read Registry Value "HKEY_CURRENT_USER\Software\Professional Grade Macros\PhtData\FirefoxAfterLoadDelay" into %N99% If Variable %N99% Is Greater Than "0" Delay: %N99% seconds Variable Set Integer %N99% to 0 Write Registry Value "%N99%" into HKEY_CURRENT_USER\Software\Professional Grade Macros\PhtData\FirefoxAfterLoadDelay End If
-
If you think it is possible to make a macro that will provide all combination within certain set of numbers, without an enormous number of loops contained within each other, I'd love to know how. I want to make clear that at one cycle, the "whole repeat loop" provides one unique combination that wasn't already calculated before. If the numbers were calculated without the consideration of the other numbers, it would lead (and I can confirm IT DID) to a situation when certain combination are calculated more than once. Here's an example:
1 2 3 4
2 3 4 1
3 4 5 2
4 5 1 3
Those four above combinations are all the SAME. One of them is enough, no need to check 2341 if 1234 was already checked. That's why all the repeat start/end commands are contained within each other, to eliminate unnecessary calculations and save time.
Thanks for providing your detailed and very interesting description.
I don't follow here.
How are the 3rd (3 4 5 2) and 4th (4 5 1 3) lines the same as any of the others? I can see that lines 1 and 2 contain the same numbers, whereas lines 3 and 4 are both unique. What am I missing?
And I don't understand the output. WHat are the 6 pixels in each line formed from?
-
How could anyone (including you) ever successfully debug this script? If you are able, using simple English, to describe in detail what this macro is supposed to do, I imagine there would be a better way of achieving your goal. In fact, I seriously doubt if any of us could find a worse way!
-
Is it possible to schedule a macro to run at a particular time of day? If so, what are the steps to scheduling a macro to run?
Alternatively, you can create an operating system scheduled task to run the following command daily at a certain time, or once, or weekly on certain day(s), etc. This method offers more capabilities, e.g. wake the machine up to run your task (but you may need to create an automatic login procedure):
QualifiedPath\Meproc.exe /AYourMacroName
where QualifiedPath is the fully qualified path to Macro Express, e.g. "C:\Program Files\Macro Express"
Ctrl + Backspace to delete a word left
in Macro Express and Macro Express Pro
Posted
Please try this and let me know how it compares with a "pure" MEP solution. I'm using AutoIt to do the select and delete operation.
Create a macro, activated with Ctrl + Shift + Left Arrow, activated as soon as the keys are pressed.