Jump to content
Macro Express Forums

cuppanews

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by cuppanews

  1. This is by design. Excel locks all open spreadsheets. If I were you I would create a macro to run while you're in Excel to save as a different name periodically on on command. IOW keep a working copy and the macro's copy. Also you could write a maro in Excel and attach it to that file to do the same thing.

     

    Randall: Excel can edit CSV files directly and I assume this is what he is doing.

    Thanks. I guess it makes sense that Excel would behave this way. Interesting.

     

    Your suggestion of a macro to get around this is good. I'll give it a shot.

  2. I'm using a CSV file with the ASCII File Process command for a lookup table. Everything is working really well so far, with one wrinkle.

     

    I'm adding new rows to the table in Excel every day, and I often have it open while I'm using the ME macro that processes the data. When the file's open in Excel, the macro fails.

     

    I'm puzzled by this. Why is the file not available to other applications while it's being edited? Obviously the saved version on the disk is the only one the macro can see, but if I save after every change in Excel, I'd have thought that ME would be able to use it even though it was still open in Excel.

     

    Is that not the case?

     

    Thanks.

  3. When I click on, say, the "Macros" menu in the Scripting Editor toolbar, the menu "slides" down into view rather than simply being displayed. It's fun the first time. ;-)

     

    I thought it might be an OS thing (although it does't happen in other applications). Sure enough, in Desktop > Appearance > Effects, the first item seems to apply here -- but changing it doesn't have any effect in this case.

  4. Hi...

     

    I want to take a URL and extract the domain name. I've written a macro that does this, but since it's something that's critical to my workflow, I'd like to ask for your thoughts.

     

    Is this the best way to do what I want? Are there any obvious flaws in what I've done?

     

    The aim here is to get the domain name into T4. The URL is in T2, a variable that is restored when the macro begins.

     

    // Restore all variables from memory.

    Variable Restore All Variables

    // Extract domain name.

    // Strip "http://".'>http://".

    Replace "http://" with "" in %T2%

    // Put the position of the first remaining slash (i.e., end of domain name + 1) into an integer variable: N1

    Variable Set Integer %N1% from Position of Text in Variable %T2%

    // Reduce the value of N1 by 1.

    Variable Modify Integer: %N1% = %N1% - 1

    // Copy everthing from position 1 to N1 into T4.

    Variable Modify String: Copy Part of %T2% to %T4%

     

    Thanks for your help!

     

    M.

  5. Sorry, I guess I didn't express it very clearly.

     

    I'm using ME to grab certain information from, let's say, a New York Times article. I get the article title, a short selection of the article text, and the URL. Then I paste that information into a webform, clean it up as needed, and post it on my site. I've got ME macros already written that help with most of this.

     

    One of the things I've been adding manually in the webform is a field called "Source". Until now, I've actually been typing out "US-New York Times" or whatever the source is for every item I post. That's the part I'd like to automate.

     

    ME already has the URL (as one of the macros I'm already using), so I'd like first to strip it down to domain name only. That I can figure out without help.

     

    Here's the part I do need help with:

     

    I'd like to search a table for the domain name and have ME return the "long form" of the name. For instance, a simple example of the table might look something like this:

     

    domain name            long form name
    -----------            --------------
    www.nytimes.com        US-New York Times
    www.globeandmail.com   Canada-Globe and Mail
    www.chinadaily.com     China-China Daily

     

    ME would search the table for 'www.globeandmail.com' and then type "Canada-Globe and Mail" into my webform. The table would be quite extensive with potentially hundreds of domain name/long form name entries.

     

    I'm not knowlegable enough about ME to know exactly how to do the table lookup thing. I'm guessing it could be a CASE statement:

     

    if domain name = "www.nytimes.com"
    then type text "US-New York Times"
    
    elseif domain name ="www.globeandmail.com"
    then type text "Canada-Globe and Mail"
    
    elseif domain name ="www.chinadaily.com"
    then type text "China-China Daily"

     

    That's just pseudocode and I haven't tried to implement it yet using ME because my hunch is that it may not be terribly efficient once there are hundreds of CASE statements to evaluate. I'm sure there's a better way of doing this and would welcome any suggestions.

     

    Hope I've made it a bit clearer... ;-)

  6. Hi...

     

    I've been using Macro Express to automate some of my editing tasks, and I'd like your advice about whether it would be practical to use it in the following way.

     

    I'm running a news site. Each day I post links to 60-70 news items originating in any of hundreds of sources. I spend a lot of time entering and re-entering things like "US-New York Times", "China-China Daily", etc. Since there are so many sources, it doesn't make sense to write (or remember) so many individual shortkeys.

     

    It's occurred to me that, since I'm already using Macro Express to capture the URL for articles, I could construct a lookup table that would take something like...

     

    http://www.abc.net.au/news/newsitems/200507/s1405363.htm

     

    ...strip out the domain name...

     

    www.abc.net.au

     

    ...then look in a table for the "long form" name and type "Australia-ABC" into my edit window.

     

    So, my question is this: would Macro Express be able to do something like that reasonably quickly if the lookup table had, say, 300-400 entries? By "reasonably quickly" I mean in about the same time it might take me to type it out manually?

     

    Thanks for any thoughts you might like to share.

  7. When you do a Mouse Click on a Control, the mouse does not actually move. When you manually click the mouse, a Windows message is generated and sent to the control (or program) under the mouse. The Mouse Click on Control sends the message without moving the mouse.

     

    Ah, OK. I understand now.

     

    Thanks, Kevin.

  8. Actually, I'm not quite there yet... ;-)

     

    When I use Mouse Click on Control and then specify X/Y coordinates under the Advanced tab, it's not moving the mouse to those coordinates. (The next command is Type Text, and it's doing so wherever the mouse pointer happens to be.)

     

    The control I'm using is the top-level browser window -- i.e., I run the Get Control utility,move the mouse pointer up to the window's top border, and then call that C1. Then I use the X/Y coordinates relative to that control's upper-left corner. Am I doing that correctly?

     

    On the other hand, this works...

     

    Mouse Move Relative to Control %C1%: 98, 352

    Mouse Left Button Click

    Text Type: %T1%

     

    I'd rather do the first two commands in a single command (Mouse Click on Control) if I can, and I thought that what you were suggesting would let me do that.

     

    Cheers.

     

    M.

  9. I have used Zonealarm for many years. Free version and Pro version, but I never had an entry of MacroExpress in Zonealarm or a message in Zonealarm coming from Macroexpress.

    It triggered an ZA alert in my system. I wonder if not Macro Express, per se, but the Macro Express editor being set to launch when Windows starts up?

  10. I'm just learning about postioning the mouse relative to a control. In doing so, I thought of what I think could be a useful enhancement to the Mouse Location tool.

     

    Is there a convenient way of measuring the X and Y offsets from the upper left corner of a control? For instance, if you want to place the cursor in a web form field, how do you calculate the number of pixels to move the mouse relative to the control? Right now, I think all you can do is note the location of the upper left corner using the Mouse Location tool, write this down. Do the same for the new X-Y position. Then subtract the latter from the former.

     

    What if you could point to the upper left corner, click and then drag the mouse pointer to the new X-Y position? I'm imagining that as soon as you pressed down on the mouse button, the displayed coordinates would go to zero and then start measuring the distance in pixels until you released the button.

     

    What do you think?

  11. Moving the mouse is not enough, you must click in the new location.

     

    Think about how you do this manually. You move the mouse to a location and the mouse arrow follows along. But until you click in the new location, the cursor stays where it was. The cursor indicates where text will appear when you type.

     

    Unbelievable. And obvious, I guess! Sigh...

     

    Thanks for the followup, Kevin. My macro runs perfectly now...

  12. I'm still trying to get this to work. If you have any ideas why it fails, I'd really like to know!

     

    I'm entering text into a web form. My script is actually a bit more complicated than this, but the following reduces the problem to its simplest form.

     

    The two screen positions (75, 284 and 75, 555) are fields in the form. The first Mouse Move puts the cursor in the first field. The first Text Type puts "Greetings" into that field. The Wait is there just to rule out the possiblity that I'm rushing the second Mouse Move. (I've also tried Wait for Text Playback and Wait Time Elapse for different durations with the same result in every case.) The second Mouse Move should put the cursor in the second field -- but it doesn't! The second Text Type appends "Hello" to "Greetings" in the first field.

    Mouse Move Screen 75, 284
    Text Type: Greetings
    Wait Time Elapse: 0 Minutes 2 Seconds
    Mouse Move Screen 75, 555
    Text Type: Hello

     

    Any thoughts?

  13. I'm using Firefox and ME. My macro starts on a web page by grabbing the window title, URL, and some highlighted text. Then it switches to another browser tab (Ctrl-1) and pastes the grabbed text into the form.

     

    The problem I'm having is that the Mouse Move command seems really erratic. Sometimes it puts the cursor in the right field, sometimes it doesn't. Sometimes it pastes the correct text in the correct field, but then immediately pastes text intended for another field immediately following.

     

    As you can see, I've put some Waits into the macro, but they don't seem to be helping.

     

    // Get the window title and copy into a string variable.
    Get Control %C1% (- Mozilla Firefox: )
    Variable Get Control Text: %C1% to %T1%
    // Copy selected text into a string variable.
    Clipboard Copy
    Variable Set String %T2% from Clipboard
    Text Type:<CONTROL>l
    // Copy the URL into a string variable.
    Clipboard Copy
    Variable Set String %T3% from Clipboard
    // Switch to the Control Panel browser tab.
    Text Type: <CONTROL>1
    Wait For Window Title: "ExpressionEngine"
    Mouse Move Screen 75, 285
    Text Type: %T1%
    Wait Text Playback
    Mouse Move Screen 75, 560
    Text Type: %T2%

     

    Any suggestions? Thanks.

×
×
  • Create New...