Jump to content
Macro Express Forums

terrypin

Members
  • Posts

    2,230
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by terrypin

  1. Hi Alan,

     

    In garden using iPad so can’t try it yet. But with the target cell selected I would expect a copy followed by set variable then a trim would deliver the text you need for the rest. Failing that, an F2, a move to the edit box, and take the copy from there.

     

    But a VBA macro would be my personal choice! Not only because it would be so much faster but it would be a refresher exercise as I haven’t done any VBA stuff for ages.

     

    Terry

  2. Hi,

     

    Perhaps because I have not yet had my first coffeee, but I’m not clear about the result you want from that example.

     

    I assume I this is your INPUT:
     

    Ceinture de Bloublou
    Niveau  160
    @DonarX11
    Michto : Kipu
    Orkou IV
    400 
    X

    =
    400     Il y a 15 Heure
    Icône

     

    So is your OUTPUT this?

     

    Ceinture de Bloublou
    Niveau  160
    @DonarX11
    Michto : Kipu
    Orkou IV
    400 
    X

    =

       Il y a 15 Heure
    Icône

     

    Or this?

     

    Ceinture de Bloublou
    Niveau  160
    @DonarX11
    Michto : Kipu
    Orkou IV
    X

    =
    400     Il y a 15 Heure
    Icône

     

    Or this?

     

    Ceinture de Bloublou
    Niveau  160
    @DonarX11
    Michto : Kipu
    Orkou IV
    400 
    X

    =
    Icône

     

    Or this?

     

    Ceinture de Bloublou
    Niveau  160
    @DonarX11
    Michto : Kipu
    Orkou IV
    400 
    X

    =

    Il y a 15 Heure
    Icône

     

    Or something else?

     

    Terry

  3. Faced with learning a new programming language or persisting with MX Pro it would be ‘no contest’ for me! But then I have no AutoCAD experience.

     

    I’d probably tackle it just as Robert suggests. However, if I’d already methodically set up an Excel spreadsheet as you have, then I’d first just try a VBA macro from Excel itself. If you have no VBA experience try recording the steps. The devil as usual will be in the details. For instance, where must the processed text end up before being executed by AutoCAD?

     

    EDIT: Thinking about it over breakfast it should be relatively straightforward in either MX Pro or Excel VBA (or a combination of both, as I've sometimes used). Screenshot shows the way my mind was working:

     

    Terry

     

    Scotsman-1.jpg

  4. 1 hour ago, Samrae said:

    If you post the content of your Macro Logs it would help us understand what is happening. Click Tools, Macro Logs to see the folder where the logs are saved.

     

    As you may have seen from my reply to Cory, the log file covering the time of the 'flood' is called macexp.exe_Events_20210325.log

    Its 250 or so entries must have finished when I forced MX Pro termination from Task Mgr

     

    THE LIKELY CULPRIT
    25 March 2021 20:59:29:054: SetBoolean error: 
      Access violation at address 00404FB0 in module 'macexp.exe'. Read of address 74736122
    25 March 2021 20:59:39:951: SetBoolean error: 
      Access violation at address 00404FB0 in module 'macexp.exe'. Read of address 74736122
    .
    .
    .
    25 March 2021 22:21:44:513: SetBoolean error: 
      Access violation at address 00404FB0 in module 'MacExp.exe'. Read of address 74736122

     

    I'd also like to raise a related question about many identical log files for a specific much used macro:

     

    EXTRACT FROM THE LOG, SHOWING MOST RECENT ENTRY (of about 1,800 since 10th Jan 2019) 
    26 March 2021 12:09:31:108: Macro Started (Open IrfanView & paste)
    26 March 2021 12:09:31:108: Line 1: Comment
    26 March 2021 12:09:31:108: Line 2: Delay
    26 March 2021 12:09:31:217: Line 3: Comment
    26 March 2021 12:09:31:217: Line 4: Delay
    26 March 2021 12:09:31:311: Line 5: Program Launch
    26 March 2021 12:09:31:342: Line 6: Delay
    26 March 2021 12:09:31:546: Line 7: Clipboard Paste
    26 March 2021 12:09:32:061: Line 9: Delay
    26 March 2021 12:09:32:248: Line 10: Macro Run
    26 March 2021 12:09:32:703: Macro Completed (Open IrfanView & paste)
    
    MY MACRO (about 15 years old)
    // Open IrfanView & paste image
    Delay: 0.1 seconds
    // Hotkey Ctrl+Shift+I
    Delay: 0.1 seconds
    Program Launch: "i_view32.exe" (Normal)
    Parameters: 
    Delay: 0.2 seconds
    Clipboard Paste
    Delay: 0.2 seconds
    Macro Run: Current window LEFT HALF Global (c+Num4)
    
    

     

    I tried to send a bug report last night, same time I posted here, but that tool appears to be buggy, giving error:

    Cannot Access Database
    An error occurred when accessing the database. Contact your Helix ALM
    administrator if the issue continues.

     

  5. Thanks Cory.

    I've never used the Log Errors or Log Messages commands in my macros. (But I checked the macro that was running at the time of this 'notification flood', to make sure one hadn't snuck in.)

     

    In Preferences > Playback > Miscellaneous I do not have 'Log all errors...' enabled.

    But in Preferences > Playback > Miscellaneous I have both of these enabled.

    "Log unusual events

    Any unusual events that occur when playing back a macro will be logged. The information will be stored in the same file where all macro log information is stored."

     

    "Notify when unusual event logged

    This option, enabled by default, displays a notification when an unusual event is logged."

     

    I'd like to have seen a few examples of 'unusual events' but I'm guessing that 'Access violation' is one. There are about 250 lines like this  in the log file called macexp.exe_Events_20210325.log

    25 March 2021 20:59:29:054: SetBoolean error: 
      Access violation at address 00404FB0 in module 'macexp.exe'. Read of address 74736122

    All identical, but in a few 'groups' separated by lines like this:

    ------------------------------------------------------------------------------------------------------------------------------------
    25 March 2021 22:19:57:745: SetBoolean error: 
      Access violation at address 00404FB0 in module 'MacExp.exe'. Read of address 74736122

     

    (BTW, I assume 'Unusual events' are not 'Errors' or 'Messages'? IOW all three are mutually exclusive definitions?)

     

    Do you add Log Errors and/or Log messages to some of your macros? Or use Log all errors? I've always assumed that would slow the speed, but never tested that.

     

    And, in general, have you found log files valuable? I've tended to treat them rather like Win 10 Event Viewer, which I avoid until desperate, as it's full of obscure warnings that I don't understand!

     

     

     

     

     

  6. Thanks both. I'm a novice about error logging so currently struggling. When I've studied some of the basics I'll no doubt be back here for help! Meanwhile the logs and their contents offer no enlightenment.

     

    Given that I've had many log reports, I can't fathom why this sudden display. Perhaps some change in Win 10 security settings following my update from 1909 to 20H2, but so far can't identify a likely culprit.

     

    Do you both include error log commands in your macros? I see that rberq does, and recall that Cory does too.

     

    Alan: What did you do after getting the notification? Did the log help you discover a problem with a macro? And was it the first time, you'd ever seen that message, as in my case? If so do you suspect any particular cause?

     

  7. Grappling with an issue I've never had before and looking for any insights please.

    While running a normally reliable macro I suddenly started getting an unstoppable succession of notifications:
    "Macro Express Pro
    An event was logged"

    MX-Logged.jpg?raw=1


    Had to use Task Mgr to terminate.

    I went to Win 10 Settings > Notifications & Actions > 'Get notifications from these apps', in order to disable them, but there is no entry for Macro Express Pro.

    NotificationsProblem.jpg?raw=1

     

  8. 12 hours ago, rberq said:

    Yes, always fun watching a macro follow your instructions in real time.

     

    My 3D Printer (recent generous and unexpected birthday present) gives me the same kick. But durations are measured in hours not seconds 🙂

     

    Quote

    pass it to text-recognition software, then parse and read out the results. 

     

    I think that would be relatively easy, as I use OCR in several macros for hard-to-get text. But, apart from the occasional inaccuracy, it seems pointless as it comes after the only long step of getting the size!

     

    I also tried several command prompt methods but all took at least as long as the straightforward macros by Alan and me. I tested one promising tool from SysInternals called DU

    https://docs.microsoft.com/en-us/sysinternals/downloads/du

    on several large folders. It was always no faster.

     

    BTW, it was accurate to the byte on all but one of my tests, C:\Users\Terry\Dropbox\.

    DU reported 27,971,874,555 bytes from 14995 'directories'. The direct method gave 27,965,987,107 from 14994 'folders'.

     

  9. We could discuss approaches using command prompts, batch files, PowerShell scripts, etc for a long time! But I think the simplest method would be to use Properties, as in my example below.

     

    // Open context menu for selected folder
    Text Type (Simulate Keystrokes): <SHIFT><F10>
    Delay: 0.1 seconds
    // Open Properties
    Text Type (Simulate Keystrokes): <ARROW UP><ENTER>
    Wait for Window Title: Properties
    // Select Name
    Text Type (Simulate Keystrokes): <SHIFT><TAB>
    Delay: 0.1 seconds
    // Move mouse to right of Size line
    Mouse Move: 320, 184 Relative to Current Window
    Mouse Left Click
    // Select text on Size line
    Text Type (Simulate Keystrokes): <SHIFT><HOME>
    Delay: 0.1 seconds
    // Capture size as a text variable and display it
    Clipboard Copy
    Variable Set String %tFolderSize% from the clipboard contents
    Text Box Display: Size of Folder
    
    <COMMENT Value="Open context menu for selected folder"/>
    <TEXT TYPE Action="0" Text="<SHIFT><F10>"/>
    <DELAY Flags="\x01" Time="0.1"/>
    <COMMENT Value="Open Properties"/>
    <TEXT TYPE Action="0" Text="<ARROW UP><ENTER>"/>
    <WAIT FOR WINDOW TITLE Title="Properties" Partial="TRUE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
    <COMMENT Value="Select Name"/>
    <TEXT TYPE Action="0" Text="<SHIFT><TAB>"/>
    <DELAY Flags="\x01" Time="0.1"/>
    <COMMENT Value="Move mouse to right of Size line"/>
    <MOUSE MOVE Option="\x02" X="320" Y="184" _PROMPT="0x000A"/>
    <MOUSE LEFT CLICK/>
    <COMMENT Value="Select text on Size line"/>
    <TEXT TYPE Action="0" Text="<SHIFT><HOME>"/>
    <DELAY Flags="\x01" Time="0.1"/>
    <COMMENT Value="Capture size as a text variable and display it"/>
    <CLIPBOARD COPY/>
    <VARIABLE SET STRING Option="\x02" Destination="%tFolderSize%" NoEmbeddedVars="FALSE"/>
    <TEXT BOX DISPLAY Title="Size of Folder" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs40 \r\n\\par %tFolderSize%\\b0\\fs20 \r\n\\par }\r\n" Left="749" Top="620" Width="575" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
      
      

     

    If that proves unbearably slow for very large folders (like C:\Windows) then let's return to those other more advanced methods. As apparent from my last post, these days when I need that sort of info I resort to intelligent googling. Life's too short!

     

    --------------------

     

    I'm not entirely clear about your client's needs? Will the macro always start in a folder, with one of its subfolders selected, as you imply? Or could the target be the current folder? How will the client select the target? What limitations are there on what JAWS can read out? For example, would the screenshot below offer another approach?

     

    And will the client be happy to use the macro successively, rather than a columnar display of folders, such as the TreeSize suggestion I made?

     

    FolderSizeAlan-2.jpg

  10. Quote

    I never thought of piping the output to another command, and to be honest I wasn't even familiar with "find". 

     

    Me neither 🙂

    But I was curious as to whether there was a way to deliver the size and little else. I tried the multitude of never used Nirsoft stuff I have, then hunted around online and came across that.

     

    I also rashly installed JAWS (30-day trial) but gave up trying to get it to talk, and promptly removed it!

×
×
  • Create New...