Jump to content
Macro Express Forums

paul

Members
  • Posts

    1,049
  • Joined

  • Last visited

Posts posted by paul

  1. Quite simply if you were at a command prompt and execute a script like VBS whatever echoes to the screen is what gets stuffed into that console variable. Did you read that post here in the forums on using HTA? Had a pretty good example.

    Yes, but the problem is how to get stuff echoed to the screen from within an HTA. Pure VBS offers the Wscript.echo command, but the Wscript environment is not available in HTAs. It is even possible to create a Wscript object and access its methods from within an HTA, but unfortunately Wscript.echo won't work using this method either. And examining the Multiple Field Input Form sample code doesn't teach me how to echo stuff to the screen.

  2. but how do I go on counting the # of characters from a text variable?

     

    when i say dynamic, it refers to copy`ing text from anywhere and putting it into a text variable. sorry if i confuse you guys :)

    Do you know how to write the command to obtain the length of a variable? If not, then I don't think I know how to help you.

     

    Populating a text variable and obtaining its length gives you the number of characters contained by the text variable.

    %tVar% = "this is a rabbit"
    Length of %tvar% is 16

    therefore %tVar% contains 16 characters.

  3. I'm running Windows 7 professional x64.

     

    I created a shortcut to UltraEdit (no compatibility mode set).

    I then ran this macro:

    Window Activate: [Edit1] - UltraEdit
    Text Type (Simulate Keystrokes): x

    and, as expected, an x duly appeared in the UltraEdit window.

     

    I then changed the properties of the shortcut, forcing Windows XP (service pack 3) compatibility, reran the shortcut, and reran the macro. It continued to work!

     

    But I see you're running MEP v1, whereas the current version is 4.2.2.1. As a general principle, I think you should always run the latest version of software unless you have a specific reason not to. For MEP, I'd emphasize this advice even more.

  4. Have you told ISS? If they could reproduce that would be awesome.

    Quite honestly, Cory, I have virtually given up on ISS! They show little interest in anything I have reported to them in the last 1-2 years, and I get no feedback from them apart from the problem registration email. And who knows whether my ability to replicate the problem most of the time is unique to my machine? If I were in tech. support and received a submission from a user along the lines of what I would report in this instance, I (the support guy) would throw up my hands in horror!

  5. If MEP installation always converts the deault macro file of my ME3, that means, I can't unload MEP, reload and run ME3 during my trial period (because now the macro file is in new format). I want to be able to switch to using either of them when trying MEP, can I?

    Have 2 copies of your macro file, 1 for ME3 and one for conversion to MEP. I don't see your problem.

  6. when you say %tClip% you are referring to the text variable %T[XX]% right? what I dont understand is the saving lenght part. As I understand it, it counts the character of whatever is stored in the text variable.

     

    would it be ok if i request an actual code? so that i can see how it is done.

     

    thanks in advance paul :)

    I have chosen to call my variable %tClip%. You can call it %T[1]% if you like, the difference being that your variable forms the 1st element of an array.

    Let me describe the process to you like this:

    On my clipboard is this text:

     

    The quick

    brown fox

    jumps over the

    lazy dog

     

    This text consists of 4 lines, each of which ends with 2 invisible characters (carriage return = ASCII 13, line feed = ASCII 10)

    So this text is exactly 48 characters long (35 non-space characters, 5 spaces, 4 carriage returns, 4 line feeds).

    If you store this text in a variable, its length will be 48 characters.

    If you now change all carriage return/line feed combinations to nothing, the length of the variable will become 40 (35 non-space characters, 5 spaces, 0 carriage returns, 0 line feeds).

    If you now subtract the new length of 40 from the original length of 48, you get 8.

    If you now divide 8 by 2 (2, because we removed 2 characters for each line), you get 4 - which is the answer to your original question "how many lines of text do I have?".

  7. I can cause this problem to occur, almost on demand! In one window I have Directory Opus or Explorer open, and in another I have VideoRedo, which has just finished saving a video file in Mpeg 2 format. Now, in window one, I navigate to the next video file I want to edit, and the MEP freeze happens, 90% of the time, while moving the cursor. Note that MEP is not being used for anything, it's simply loaded (Windows 7 Professional, x64).

  8. I understand that there will be a conversion of ME3 macros if I install MEP for a trial and the conversion is irreversible... 

     

    Is the installation of MEP converts my ME3 macro file directly (making it no more ME3 format)  or does it produce new MEP macro file base on the existing ME3 macro file ?

     

    In brief, I want to be able to go back to ME3 easily, just in case...

    What's wrong with taking a copy of your ME3 macro file before converting?

     

    My take on MEP differs from Cory's. Although there are many new features in MEP (some of which are, or ought to be, very powerful and useful), several of them require some effort to learn, and in all cases you'll have to rework/rewrite your macros to take advantage of them. And you can't miss what you've never used! If your ME3 macros are all satisfactory, then I'd be inclined not to upgrade - MEP is still very buggy and doesn't seem to receive the same degree of attention from Insight as ME3 certainly used to. Many of its operations are far slower than they are in ME3, and some simply don't work properly (the worst example of this is running a macro directly from a variable; if you make use of this feature in ME3, then you should forget MEP altogether). And many of us experience an ongoing problem where MEP causes the machine to go very slowly indeed until it's terminated and restarted (and this is one of many problems Insight seems to have no interest or ability to resolve).

     

    MEP is a very mixed bag.

  9. - Save the contents of the clipboard to a variable, e.g. %tClip%

    - Save Ascii 13 to a variable, e.g. %tCr%

    - Save Ascii 10 to a variable, e.g. %tLf%

    - Save the length of %tClip% into a variable, e.g. %nLen%

    - Replace all %tCr%%tLf% with "" (i.e. a zero-length string) in %tClip%

    - Save the new length of %tClip% into a variable, e.g. %nLenNew%

    - Subtract %nLenNew% from %nLen% into a variable, e.g. %nDiff%

    - Divide %nDiff% by 2 - and this is your answer

     

    Beware of any final line in the clipboard - if it doesn't end with %tCr%%tLf%, then you'll need to allow for this (e.g. extract the last 2 characters of %tClip% and compare with %tCr%%tLf% - if unequal, append %tCr%%tLf% to %tClip%).

  10. If I understand you correctly, then you have this calling hierarchy of macros:

    Macro A

    -- Macro B

    -- Macro C

    ---- Macro D

     

    I assume that a decimal variable %DTV% is declared in each macro, and that when one macro calls another, it always waits for the called macro to finish.

     

    I have created the following code, and it works as expected. In other words, the two display boxes of the value of %dtv% in both macros D and A show the same value of 0.5.

     

    My guess is that you may not have declared %dtv% in Macro A when you first tested your code, in which case it may be that MEP has got confused (MEP gets quite easily confused about variables if they're not declared right the first time). If I'm right, I suggest recreating the 4 macros, making sure you declare the relevant shared variables right the first time (you can easily copy the code from your existing macros to the new ones).

    MacroA
    ------
    Macro Run: MacroB
    Macro Run: MacroC
    Text Box Display: MacroA
    
    MacroB
    ------
    Variable Set Decimal dtv to 1.05
    
    MacroC
    ------
    Macro Run: MacroD
    
    MacroD
    ------
    Variable Modify Decimal: %dtv% = %dtv% - .55
    Text Box Display: MacroD
    

    MacroA
    ------
    <MACRO RUN Use_ID="FALSE" Name="MacroB" ID="-1" Wait="TRUE"/>
    <MACRO RUN Use_ID="FALSE" Name="MacroC" ID="-1" Wait="TRUE"/>
    <TEXT BOX DISPLAY Title="MacroA" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 dtv = %dtv%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="2" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
    
    MacroB
    ------
    <VARIABLE SET DECIMAL Option="\x00" Destination="dtv" Value="1.05"/>
    
    MacroC
    ------
    <MACRO RUN Use_ID="FALSE" Name="MacroD" ID="-1" Wait="TRUE"/>
    
    MacroD
    ------
    <VARIABLE MODIFY DECIMAL Option="\x01" Destination="%dtv%" Value1="%dtv%" Value2=".55"/>
    <TEXT BOX DISPLAY Title="MacroD" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 dtv = %dtv%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="2" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
    

  11. is this true for my scenario too? I never mentioned global macros but programspecific vs windowspecific ones.

    I've tried this example:

    - Macro M1 global, Ctrl-Shift-K

    - Macro M2 notepad window specific, Ctrl-Shift-K

    - Macro M2 notepad program specific, Ctrl-Shift-K

     

    I am unable to get more than one of these macros to run when Ctrl-Shift-K is pressed:

    - if notepad is not running, M1 fires

    - if notepad is running and focused, m2 starts

    - in order for m3 to start, m2's scope is changed to, say, xnotepad

     

    If these observations are correct, then I think that answers your question. Do you experience the same sequence of events?

  12. I have the following scenario. I have a lot of programspecific macros with certain hotkeys like ALT + E for example.

     

    I do want those to work but want to have some other specific macros to run instead if the program has this specific window title.

     

    What is the most efficient way to do this? Of course i could code an "if window-title"-check into the programspecific macro but than i would have two macros in one which i find confusing.

    Suppose you have 2 macros, M1 and M2, where both run with ALt-E and where M1 is global, M2 is program specific. Remove M2's Alt-E activation, and put your If Window Focused test for the M2 window at the beginning of M1. If the window is focused, simply have M1 call M2 and exit M1. I don't think that's so complicated. When M1 calls M1, have M1 not wait for M2 to complete.

     

    You could even automate this. Instead of M1 and M2, call them M1 and M1 [xxx], where xxx is the name of the window you're checking for focus. Now, in M1, simply check for the existence of macro M1 [xxx] and call it if it exists, otherwise continue with M1. You could use this approach for all macros which have both specific window and global hotkey activation.

  13. i did that and my taskbar became ...well... half a tray! ;-)

    Redwards' suggestion about making the taskbar taller is a good one, and what I've done too.

     

    Do you know if you still can kill macros by rightclicking forrest. That worked in MEX but last time i tried it in MEX Pro i could not even kill the mexpro.exe process and had to restart the pc with the powerswitch which i hate.

    This does work most of the time - occasionally Forrest remains and I then close and restart ME to get rid of it.

  14. Unfortunately, the only way reliably to see Forrest any time a macro is running is to force W7 to display all icons all the time. While this may be a bug in Macro Express (God knows there far too many of these in ME Pro, few of which seem to get fixed these days), I believe it's more likely to be a problem in W7. My tray currently has 17 icons on display, which isn't so bad considering I have 3 monitors.

  15. Have you thought about loading the ME macro into a variable and using the Run Macro In Variable command? In ME3, this command works exceedingly well, whereas be warned that it's almost completely useless in ME4 (ME Pro) because Insight never thought about the design of this feature and forgor to implement user variables correctly in this feature!

     

    I have loaded variables and run macros from them of considerable length and complexity in ME3 with great success.

  16. For which part of this process do you need suggestions? None of this looks particularly difficult - as a last resort you could record the keystrokes you use when you do this manually. My advice is always to use menus if possible, e.g. to invoke the direct editor you could locate the icon and click on it, or (in Macro Express Pro) you can use the menu option View.

     

    I have written many macros that manipulate Macro Express itself, and most of these have been relatively straight-forward.

  17. There is a way to achieve what you want, but it's slightly tricky!

    You need 2 macros for this:

    Macro1
     Macro Run: Macro2
     Window Activate: Notepad
     Delay: 1 seconds
     Repeat Until %n[1]% Does not Equal "%n[1]%"
       If Not Window "Respond Y or N" is running
         Repeat Exit
       End If
     End Repeat
    
    Macro2
     Multiple Choice Menu: Respond Y or N
     code to process Accept or Undo

     

    - In my example, I'm activating Notepad rather than your open document

    - The window title in the Repeat loop must match the title of your multiple choice menu

    - It is essential that the macro run statement in Macro1 does not wait for Macro2 to terminate before proceeding

    - The multiple choice menu statement must be in a separate macro, otherwise you cannot return focus to your document window

    - The logic to process Accept or Undo is in Macro2, which is the only macro to know what the user response was; you either have to click on the menu choice you want, then press Enter, or, in my example, you can activate the menu window and press Alt-y or Alt-n followed by Enter. If you were happy to write a small amount of AutoIt code, then I imagine the whole thing could be made more elegant and less clunky.

     

     

    And here's the actual code:

     

    Macro1
    <MACRO RUN Use_ID="FALSE" Name="Macro2" ID="-1" Wait="FALSE"/>
    <WINDOW ACTIVATE Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x01" Time="1"/>
    <REPEAT UNTIL Variable="%n[1]%" Condition="\x01" Value="%n[1]%"/>
    <IF NOT WINDOW Option="\x01" Title="Respond Y or N" Partial="TRUE" Wildcards="FALSE"/>
    <REPEAT EXIT/>
    <END IF/>
    <END REPEAT/>
    
    Macro2
    <MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%tResponse%" Title="Respond Y or N" Prompt="Do you want to accept the result?" Options="&Yes\r\n&No" Left="Center" Top="Center" Monitor="0" Width="443" Height="296" OnTop="TRUE"/>

  18. There are 2 main approaches to consider:

    - You can write a macro that is activated when you click your mouse to navigate to the next record. Each time the macro runs it needs to read in the record number last used (from the registry, or from a file, or from an environment variable), increment that counter by one, and then do whatever processing you have determined is needed.

    - Or you can write a macro that remains in control of the whole process of navigating your records; in this case it must navigate to the next record by clicking the mouse in the relevant area of your screen; you could trigger this next record activity by having the macro wait for a specified keystroke - e.g. N for Next record, or PgDn - and then take the appropriate action, or by presenting a menu - e.g. Next Record, Previous Record perhaps?, etc.

     

    The first method results in your macro running each time you navigate to the next record, while the second approach has your macro being run only once, remaining in control until you exit it, e.g. using the Esc key if you adopt the menu approach. In the second approach your macro can navigate to the relevant web page, etc.

  19. BTW, you haven't answered my question.

    Sorry, please can you repeat it?

     

    From your latest screenshot I now see you haven't got the Stop button anywhere on any toolbar. So it must be in your customize window - did you try scrolling down to the bottom (on my machine the Stop button, when not located on a toolbar, is the last button in the customize window).

     

    Yes, I always close FF before editing any user files.

     

    And I now see I wasn't addressing the userchrome.css file, but rather the usercontent.css file.

     

    And here are my screenshots for your enjoyment!

     

    post-10-0-79462400-1301274048_thumb.png

     

    post-10-0-31401500-1301274065_thumb.png

×
×
  • Create New...