Jump to content

Simple Script Help


Recommended Posts

So I've been using AutoIt for awhile now but I'm sure what I use it for can be sped up a good bit by a better written script.

This is the current (and rather mundane, but works!) script that I've been using.

Opt ("WinTitleMatchMode", 2)

HotKeySet ( "{Esc}", "restart" )
HotKeySet ( "{ENTER}", "enter" ) 

Func restart()
    MouseClick ( "left", 1902, 1113, 25 )
    If @Compiled = 1 Then
        Run( FileGetShortName(@ScriptFullPath))
    Else
        Run( FileGetShortName(@AutoItExe) & "DescriptionsOO.au3" & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc

Func enter()
    Send ( "^{s}" )
    WinActivate ( "Opera" )
    Send ( "^{w}" )
    Winactivate ( "OpenOffice" )
    HotKeySet ( "{ENTER}" )
    Send ( "{ENTER}" )
    HotKeySet ( "{ENTER}", "enter" )
EndFunc
    
$i = 1
Do 
    Winactivate ( "OpenOffice" )
    MouseClick ( "left", 1211, 181, 1 )
    Send ( "^{c}" )
    WinActivate ( "Opera" )
    Send ( "^+{v}" )
    $i = $i + 1
Until $i = 2

Do 
    WinActivate ( "OpenOffice" )
    Send ( "{DOWN}" )
    Send ( "^{c}" )
    WinActivate ( "Opera" )
    Send ( "^{t}" )
    Send ( "^+{v}" )
    $i = $i + 1
Until $i = 26

WinActivate ( "Opera" )
Send ( "^+{F6 24}" )
Winactivate ( "OpenOffice" )
Send ( "{RIGHT}" )
Send ( "{UP 24}" )

Sleep ( 100000000 )

As you can see it's a very simple script, but I was wondering if there's a way that I can open this data a bit faster (i.e. it takes it around 6 or 7 seconds to open 25 links when I'm sure that can be increased substantially.) I figured gathering the data into an array and being able to take the first array data and open in a new window in Opera, then take the second data, repeat, etc.

I just don't understand how to actually do it :mellow:

Link to comment
Share on other sites

I'm guessing you are opening many links that you have saved in an OpenOffice Calc sheet? Is there a particular reason you need to do it this way? If the links are the same every time, then please just use Opera to bookmark them once and afterwards open them all at the same time by clicking on "Open all folder items".

If you somehow obtain a Calc sheet with different URLs every time which you have to open, try Manadar's suggestion in combination with the Excel UDF (#include <Excel.au3>). You can open Excel without showing its window and quickly queue the ShellExecute commands.

post-29125-12670150896391_thumb.png

Edited by d4ni
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...