Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,232
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by terrypin

  1. "...arrange them to suit me, minimise some of them, hide others (e.g. with my browser)..." I think we're at cross-purposes. Do you mean the plain english meaning of 'hide' or the technical Windows attribute, used in ME Pro, called 'Hidden'. Your original post was a bit cryptic and I'd hoped my reply would have prompted some amplification. But I'm still not clear what you meant or mean? The whole point of this macro is to re-display folders that may have become hidden by other windows, and - now that I've found that distinction about Exact & Partial that I've described, it works OK. What other code did you have in mind? -- Terry, East Grinstead, UK
  2. This is nothing to do with ME Pro but I'm wondering if it rings a bell with any other Firefox user. I keep an FF tab open to the MEP forum (frozen, so I can't accidentally delete it). But whenever I return to FF after an hour or so to check the forum, it has switched to the 'Board Message' mode. Just as if I've tried to make a Search. It always displays the message that you get if you've tried to search with less than 4 characters. Bizarre. Been happening for weeks. Some obscure bug? Some malicious intervention? Today I tried keeping the same page open in IE7 too, and so far that remains unchanged. So looks like it's confined to FF. Any ideas anyone please? -- Terry, East Grinstead, UK
  3. Sorted! This was a salutary lesson for me. And it might be interesting to any others who have been casual about 'Exact Match' versus 'Partial Match' when specifying windows. I'd assumed that if I want to restore the window called C:\ABC\xyz then it's immaterial whether I use Partial or Exact. It should logically get activated whichever of those two options I use. Certianly, that's always been the case in other macros I've written in the past using Activate, Wait, etc (Of course, with Partial, other similarly named windows might also get activated, but there's no such ambiguity in the macro under discussion.). However, it turns out that my assumption was apparently incorrect. Here are the results for all 4 combinations: Window Activate: Partial Wait for Window Title: Partial Result: Fails (several windows don't get restored) Window Activate: Exact Wait for Window Title: Partial Result: OK Window Activate: Partial Wait for Window Title: Partial Result: Fails (macro never finishes) Window Activate: Exact Wait for Window Title: Exact Result: OK So, the macro works as long as the Window Activate command specifies Exact match, regardless of how the Wait command is specified. I'd be interested to hear from ISS on the underlying cause of this please? I suspect there are other situations as well as this Repeat with Windows loop where the same distinction applies. -- Terry, East Grinstead, UK
  4. Could it be used for the more general purpose discussed in http://pgmacros.invisionzone.com/index.php?showtopic=3568 ? -- Terry, East Grinstead, UK
  5. Steve: I can't help with your specific either, sorry. But if it makes you feel any better I've spent most of this morning increasingly frustrated by what should be a really simple web form-filling macro. This is to enter my gas and electricity meter readings online, in Firefox. The first stage requires 3 boxes filling: electricity account number, gas account number and post code. After using my own pixel-testing macro to wait for the page to be ready, the first box takes 44 tabs to reach, and then each of the other two are just one tab apart. But no matter what delays I use, the macro acted as if it was 'running on' and trying to go to the next web page (to enter the readings). Eventually I abandoned it and re-wrote it using mouse clicks to get the cursor into the boxes, instead of tabbing, and that worked. But I'd love to know why the original tabbing method didn't. (The sting in the tail was that, although the macro worked, the site refused to accept my readings. After 20 mins in a phone queue to British Gas I learned that their system had broken!) -- Terry, East Grinstead, UK
  6. Thanks Cory. I've edited the original to avoid the horizontal scrolling requirement, which I dislike too. I'll use that method from now on, assuming there's no problem? I'm hoping PGM might get around to fixing this and other forum issues soon, as discussed in the thread http://pgmacros.invisionzone.com/index.php?showtopic=3711 including the silly inability to search for 3-character words. Re the macro, I don't do any renaming in this, I just simply activate each window in turn. I'll play with it a bit more and try your suggestion, but I'm about ready to give up on it. Just doesn't seem to make any sense. If anyone else has time to experiment, here's a simplified version: Repeat with Windows: Visible Windows: Store in variable CurrentWindow If Variable %CurrentWindow% Contains ":\" // An Explorer window (assuming title shows full path) Window Activate: %CurrentWindow% Wait for Window Title: %CurrentWindow% End If Delay: 200 milliseconds End Repeat <REPEAT WITH WINDOWS ToRetrieve="\x01" SortOrder="\x00" Destination="CurrentWindow"/> <IF VARIABLE Variable="%CurrentWindow%" Condition="\x06" Value=":\\" IgnoreCase="FALSE" _COMMENT="An Explorer window (assuming title shows full path)"/> <WINDOW ACTIVATE Title="%CurrentWindow%" Exact_Match="FALSE" Wildcards="FALSE"/> <WAIT FOR WINDOW TITLE Title="%CurrentWindow%" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <END IF/> <DELAY Flags="\x02" Time="200"/> <END REPEAT/> You just need to open a bunch of folders (on the C: drive unless you change the code of course), minimise a few, hide some or all with other applications, etc, and see if they all re-appear OK when you run the macro. -- Terry, East Grinstead, UK
  7. Why is that relevant? I don't want to see any 'Hidden' windows, if that's what you mean by 'not visible'. All open Windows Explorer folders are 'Visible' windows and those are the only ones I want to restore. -- Terry, East Grinstead, UK
  8. This has been vexing me for ages, so I'd appreciate it if someone can see why it's not working please. You may remember I recently posed the problem of how to restore a set of Explorer/My Computer folders from a 'grouped' taskbar entry (because Windows surprisingly lacks such a facility). I subsequently wrote the following macro that should do it IMO. But it produces erratic results. Sometimes only a few of the windows open and the macro continues running. Sometimes the macro finishes but there's just one of many windows not opened. In case it's not clear, the macro opens all visible windows one by one, tests to see if the title matches the criteria for an Explorer folder (but excludes my text editor window, which would also qualify otherwise), then activates that window. // Assumes titles show full path Repeat with Windows: Visible Windows: Store in variable CurrentWindow // Activate only Explorer folders, which can be identified by containing the string ':\' If Variable %CurrentWindow% Contains ":\" // An Explorer window (assuming title shows full path) And If Variable %CurrentWindow% Does not Contain "Latest - TextPad" // This ensures that my text editor does not get included, despite having a title like 'Latest - TextPad - [C:\Docs\SUNDRY\Desktop Layouts\Test .txt]' Window Activate: %CurrentWindow% Wait for Window Title: %CurrentWindow% End If Delay: 200 milliseconds End Repeat CODE <COMMENT Value="Assumes titles show full path"/> <REPEAT WITH WINDOWS ToRetrieve="\x01" SortOrder="\x00" Destination="CurrentWindow"/> <COMMENT Value="Activate only Explorer folders, which can be identified by containing the string ':\\'"/> <IF VARIABLE Variable="%CurrentWindow%" Condition="\x06" Value=":\\" IgnoreCase="FALSE" _COMMENT="An Explorer window (assuming title shows full path)"/> <AND/> <IF VARIABLE Variable="%CurrentWindow%" Condition="\x07" Value="Latest - TextPad" IgnoreCase="FALSE" _COMMENT="This ensures that my text editor does not get included, despite having a title like\r\n'Latest - TextPad - [C:\\Docs\\SUNDRY\\Desktop Layouts\\Test .txt]'"/> <WINDOW ACTIVATE Title="%CurrentWindow%" Exact_Match="FALSE" Wildcards="FALSE"/> <WAIT FOR WINDOW TITLE Title="%CurrentWindow%" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <END IF/> <DELAY Flags="\x02" Time="200"/> <END REPEAT/> To test it I just open a set of 8-10 My Computer folders (with full paths shown in titles), arrange them to suit me, minimise some of them, hide others (e.g. with my browser), and then run the macro. I want and expect all folders to appear just as they did originally, with none hidden. But I'm darned if I can do it. Replacing the Wait with a Delay doesn't seem to help, nor does adding extra delays. Hope someone here can spot the flaw! -- Terry, East Grinstead, UK
  9. I guess I've always thought thoroughness required it! Is it (and Macro Stop) redundant? If so, what are they intended for? -- Terry, East Grinstead, UK
  10. Thanks - works OK now. -- Terry, East Grinstead, UK
  11. I get the same. It seems that it's reversed. (Maybe so for other entries too.) I also don't see why the command is designed (for example) to return TRUE for If the Window Does Not Exist, which seems counter-intuitive to me. BTW, while working on this simple macro, I managed to lose the command dialog box. So that when I returned to Script Editor (from composing this message in Firefox) it was as if ME Pro had frozen. It was exactly the same as I described in a separate post earlier today, http://pgmacros.invisionzone.com/index.php?showtopic=3788 -- Terry, East Grinstead, UK
  12. I think I've sort of always known it -- Terry, East Grinstead, UK
  13. OK, thanks, missed that. -- Terry, East Grinstead, UK
  14. I assume you mean without using another global variable as I've done here? Parent Macro Variable Set String %T[1]% to "Initial value of T1 in Parent macro" Text Box Display: Parent Global Variable Set String %TextHolder% to "%T[1]%" Macro Run: TEMP-Cory-Submacro Macro Return <VARIABLE SET STRING Option="\x00" Destination="%T[1]%" Value="Initial value of T1 in Parent macro"/> <TEXT BOX DISPLAY Title="Parent Global" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 T1 = \\f1 %T[1]%\r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <VARIABLE SET STRING Option="\x00" Destination="%TextHolder%" Value="%T[1]%"/> <MACRO RUN Use_ID="FALSE" Name="TEMP-Cory-Submacro" ID="-1" Wait="TRUE"/> <MACRO RETURN/> SubMacro Variable Set String %T[1]% to "Initial value of T1 in submacro" Text Box Display: Submacro value Variable Set String %T[1]% to "%TextHolder%" Text Box Display: Submacro value Macro Return <VARIABLE SET STRING Option="\x00" Destination="%T[1]%" Value="Initial value of T1 in submacro"/> <TEXT BOX DISPLAY Title="Submacro value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 T1 = \\f1 %T[1]%\r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <VARIABLE SET STRING Option="\x00" Destination="%T[1]%" Value="%TextHolder%"/> <TEXT BOX DISPLAY Title="Submacro value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 T1 = \\f1 %T[1]%\r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO RETURN/> -- Terry, East Grinstead, UK
  15. I'm not sure I follow you on this Cory. Is there some penalty in performance due to these built-in variables? When asked to specify a variable in a new command I find it handy to be offered say 'N[]' and I just enter the '1' to get '%N[1]%' as the result. Of course, sometimes I will want to use the extra flexibility now available, and give a meaningful name of my own, such as %CountLines% or whatever, although that requires a few extra keystrokes. A minor downside is that I then have to scroll down the unused 99 N or T variables to find it in the Variable Debugger. -- Terry, East Grinstead, UK
  16. Nice idea. Meanwhile it would be good to simply see a member's Profile, but (as I reported some weeks ago in http://pgmacros.invisionzone.com/index.php?showtopic=3711 post #5) you just get: "Sorry, but you do not have permission to use this feature." BTW, until I saw monaghana's post, I thought the answer to your query about a similar post was my thread here: http://pgmacros.invisionzone.com/index.php?showtopic=3722 To answer your other query, luckily that contained some keywords longer than 3 characters which I remembered, so I was able to find it! -- Terry, East Grinstead, UK
  17. Maybe I've misunderstood? Having opened a command, using Ctl+Tab gets me straight to On Error, and repeating that brings up Comments. (Or, for the latter, a click on the Comments tool is faster.) -- Terry, East Grinstead, UK
  18. I'd noticed that too. Like you, I would prefer to see no such restriction. -- Terry, East Grinstead, UK
  19. Cory, I'm getting "Line 93 Text to Serial Time : Debug Error: Undefined variable or the variable is the wrong type" -- Terry, East Grinstead, UK
  20. Thanks, but as per my other post I don't have a PGM licence. Also, I'm not sure I see what it's doing. It appears to be converting the current date/time, whereas I want to be able to convert any date/time. -- Terry, East Grinstead, UK
  21. Good to hear it, thank you. -- Terry, East Grinstead, UK
  22. As discussed in the thread http://pgmacros.invisionzone.com/index.php?showtopic=3667 I thought I did have the library, from the CD in 'Macro Express Explained'. But, although Joe didn't explicitly say so in his subsequent reply, I assume that was a trial version as I get asked for a password. But as I understand it the library is being updated to ME Pro anyway, so I'll consider a licence when that's finished. But which of the many PGM 'Date and Time' macros converts a date to a serial date? BTW, as a footnote to the long-standing gripe by me and others about the inexplicable inability of this forum's search facility to allow 3-letter words, as for example discussed in this thread http://pgmacros.invisionzone.com/index.php?showtopic=3711 add 'pgm' to the list! -- Terry, East Grinstead, UK
  23. I spent some time today trying in vain to import an MEX file (Cory's Text to Date macro, see separate thread). My problem seems to be the one originally discussed in http://pgmacros.invisionzone.com/index.php?showtopic=3585 After trial and error I eventually succeeded by resizing and repositioning ME Pro Explorer. The cause is that the import dialog does not come to the top, but remains hidden, making it appear that ME Pro has frozen. Is this still on the 'bugs to be fixed' list? -- Terry, East Grinstead, UK
  24. I'm guessing you found Zeller's Congruence as I did, perhaps at http://en.wikipedia.org/wiki/Zeller%27s_congruence ? It seems ME Pro has no direct MOD command so (after first converting decimal to integer if necessary) you could do it with the three Variable Modify commands I used in this simple demo: Repeat Until %T[1]% Does not Equal "%T[1]%" // Repeat indefinitely (User will stop the macro manually) Variable Set Integer %N[1]%: Prompt // Choose a number Variable Modify Integer: %N[2]% = %N[1]% / 7 // Divide it by 7, taking the whole number result N2 Variable Modify Integer: %N[3]% = %N[2]% * 7 // Multiply N2 by 7 to get an intermediate result N3 Variable Modify Integer: MOD = %N[1]% - %N[3]% // Display results Text Box Display: Results End Repeat <REPEAT UNTIL Variable="%T[1]%" Condition="\x01" Value="%T[1]%" _COMMENT="Repeat indefinitely\r\n(User will stop the macro manually)"/> <VARIABLE SET INTEGER Option="\x01" Destination="%N[1]%" Prompt="Enter any number" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0" _COMMENT="Choose a number"/> <VARIABLE MODIFY INTEGER Option="\x03" Destination="%N[2]%" Value1="%N[1]%" Value2="7" _COMMENT="Divide it by 7, taking the whole number result N2"/> <VARIABLE MODIFY INTEGER Option="\x02" Destination="%N[3]%" Value1="%N[2]%" Value2="7" _COMMENT="Multiply N2 by 7 to get an intermediate result N3"/> <VARIABLE MODIFY INTEGER Option="\x01" Destination="MOD" Value1="%N[1]%" Value2="%N[3]%" _COMMENT="Display results"/> <TEXT BOX DISPLAY Title="Results" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n{\\colortbl ;\\red255\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\f0\\fs16 N1 = %N[1]%\r\n\\par N2 = %N[2]%\r\n\\par N3 = %N[3]%\r\n\\par \r\n\\par \\cf1\\b MOD(N1,7) = %MOD%\\cf0\\b0\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="233" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END REPEAT/> Then you'd convert as appropriate, e.g. 0 = Sunday, 1 = Monday, etc. I'm off for a week's walking holiday in Portugal in a few hours. Look forward to seeing your solution on my return in a week or so! -- Terry, East Grinstead, UK
  25. Thanks Cory. I'd be very interested in the algorithm for determining the decimal value. I too would have hoped ISS might have turned it into a macro by now... Meanwhile, to complete Alan's code, it would be good to have a macro (or algorithm) for day of the week (not year). For example, given D = 3, M =4, Y = 2009, then Dw = 'Friday'. -- Terry, East Grinstead, UK
×
×
  • Create New...