Jump to content
Macro Express Forums

monaghana

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by monaghana

  1. Perhaps simplest would be to do this:

    // Save position of mouse
    Variable Set Integer %X%: Set to the Mouse X Coordinate
    Variable Set Integer %Y%: Set to the Mouse Y Coordinate
    
    Text Type (Simulate Keystrokes): <ALTD>d<ALTU>
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <CTRLD>c<CTRLU>
    Delay: 0.1 seconds
    Variable Set String %URL% from the clipboard contents
    
    // Restore position of mouse
    Mouse Move: %X%, %Y% Relative to Screen
    Delay: %Delay% seconds
    Mouse Left Click

    This moves the mouse but moves it back.

     

    Thanks for the suggestion. I knew that method, but was hoping there was a neater way of doing it.

  2. ' Set your settings
    strFileURL = "%URL to Download%"
    strHDLocation = "%Local File Name%"
    
    ' Fetch the file
    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
    
    objXMLHTTP.open "GET", strFileURL, false
    objXMLHTTP.send()
    
    If objXMLHTTP.Status = 200 Then
      Set objADOStream = CreateObject("ADODB.Stream")
      objADOStream.Open
      objADOStream.Type = 1 'adTypeBinary
    
      objADOStream.Write objXMLHTTP.ResponseBody
      objADOStream.Position = 0	'Set the stream position to the start
    
      Set objFSO = Createobject("Scripting.FileSystemObject")
    	If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
      Set objFSO = Nothing
    
      objADOStream.SaveToFile strHDLocation
      objADOStream.Close
      Set objADOStream = Nothing
    End if
    
    Set objXMLHTTP = Nothing

     

    Cory, I am aware that it is possible to use external scripts, but how do you actually use this from within a macro?

     

    I know you put the script part in the 'External Script' command and assign a variable, say %T1%, but which command(s) do you use to execute the code? Help is not too helpful with this.

     

    Regards,

     

    Alan Monaghan

    Kirkcaldy, Scotland

  3. I tried that, but upon re-opening ME, it returned.

     

    notbob,

     

    I have just tried this and what you say is correct. This seems to be since the latest release 4.1.1.1 as I tried it prior to upgrading and the Sidebar *and* the Toolbar remained hidden after restarting MEP. With the latest relaese they both reset to being visible after restarting MEP.

     

    They do remain hidden for the duation of a session though, so more an annoyance than anything else.

     

    If you like, I will submit this as a bug.

     

    Alan Monaghan

    Kirkcaldy, Scotland

  4. Does anyone know if it is possible to define the amount of elements in an array which can be used to set the number of array elements? I know that I can use the %T% variables etc. but I would like to define them first.

    What I am trying to do is take a screenshot of a Reflection console in order to extract field values. I would save these to a variable first and save this to a file. Text process the file to extract the number of lines on the screen and use this value to define the number of elements required in the array. The problem is, MEP doesn't seem to allow you to use a variable in the Variable Properties dialog box. I know I could probably get away with the built-in arrays, but I thought it would be neater my way.

     

    Any suggestion?

     

    Alan Monaghan

    Kirkcaldy

    Scotland

×
×
  • Create New...