Jump to content

AutoIT "eats" letters


yton
 Share

Recommended Posts

Greetings,

ClipPut("")
Run("Z:\firefox\App\Firefox\firefox.exe -ProfileManager --no-remote /Prefetch:1")
WinWaitActive("Firefox - Choose User Profile")
Send("myprofile")
Send("{ENTER}")

$oExcel = _ExcelBookOpen($path4)
_ExcelSheetActivate($oExcel, "")
$aArray = _ExcelReadArray($oExcel, 1, 13, 31, 1)
_ArrayToClip($aArray, 1)
_ExcelBookClose($oExcel)

WinWaitActive("Mozilla Firefox")
For $i = 1 To 3
    Send($aArray[$i])
    Sleep(5000)
    Send("^n")
Next

here's my script

I fetch data from excel (certain column), then paste array elements as URL's in FF windows

the script works but I face 2 problems:

1) For $i = 1 To $Array[0] - doesn't work (works only if I set definite number like in the script above)

2) Autoit "eats" first letter of URL and instead of http://google.com I get ttp://google.com (example)

puzzled...

please, help

Link to comment
Share on other sites

First it's probably a 0 based array so 1 and [0] are both wrong

Second, why are you messing with _ArrayToClip(), or for that matther the clipboard at all?

Run("Z:\firefox\App\Firefox\firefox.exe -ProfileManager --no-remote /Prefetch:1")
WinWaitActive("Firefox - Choose User Profile")
;;Send("myprofile") ;;<< commented out for demo purposes
;;Send("{ENTER}") ;;<< commented out for demo purposes
$sStr = "myprofile" & @CRLF ;; Added for demo

$oExcel = _ExcelBookOpen($path4)
_ExcelSheetActivate($oExcel, "")
$aArray = _ExcelReadArray($oExcel, 1, 13, 31, 1)
_ExcelBookClose($oExcel)

;WinWaitActive("Mozilla Firefox") ;;<< commented out for demo purposes
For $i = 0 To Ubound($aArray) -1
    ;Send($aArray[$i]) ;;<< commented out for demo purposes
    ;Sleep(5000) ;;<< commented out for demo purposes
    ;Send("^n") ;;<< commented out for demo purposes
    $sStr &= $aArray[$i] & @CRLF
Next

MsgBox(0, "Result", $sStr
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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...