Jump to content

From Old to New


Recommended Posts

I am undergoing a very large overhaul of updating my old scripts that use IE.au3 (the original) to the new version. But I am having a hard time getting used to the new version, after I got used the older one. Can you help me rewrite this simple script, so that it works with the new version? It would help me get a grasp on things, so when I take on my more elaborate scripts, it won't be soo hard.

Thanks in advance.

Func Edit_Descriptions_Page ($var)
;Edit Description on the IE Page
sleep (2000)
$o_SearchForm = _IEFormGetObjByIndex ($o_IE, 0)
$o_Keywords = _IEFormElementGetObjByIndex ($o_SearchForm, "description" & $var)
_IEAction($o_Keywords,"focus")
Sleep (2000)
_IEAction($o_Keywords,"selectall")
Sleep (2000)
Send("{CTRLDOWN}c{CTRLUP}")
$description_text = ClipGet ()
ToolTip ($description_text)
Sleep (1000)
ToolTip ("")

If $description_text = $CIS_AA_Text Then
    _IEFormElementSetValue ($o_Keywords, $CIS_AA_Text_NEW)
EndIf
Sleep (1000)

If $description_text = $CIS_Text Then
    _IEFormElementSetValue ($o_Keywords, $CIS_Text_NEW)
EndIf
Sleep (1000)

If $description_text = $FA_Text Then
    _IEFormElementSetValue ($o_Keywords, $FA_Text_NEW)
EndIf
Sleep (1000)

If $description_text = $DA_Text Then
    _IEFormElementSetValue ($o_Keywords, $DA_Text_NEW)
EndIf
Sleep (1000)

If $description_text = $SF_Text Then
    Sleep (1000)
    GUI_3_Pick_Categories ()
    
    If $Ubound_Value > 1 Then 
        $SF_Text_NEW = $SF_Text_NEW_ies
    EndIf
    
    $Description_New = StringReplace ( $SF_Text_NEW, $xxxxxxxxx, $String_Replacement)
    _IEFormElementSetValue ($o_Keywords, $Description_New)
EndIf
Return
EndFunc
Link to comment
Share on other sites

I don't see anything in that script that would be different from T1 to T2. What troubles are you having?

There are new features in T2 for you to take advantage of, but that causes no update trouble. There are some functions that have been removed and some that have been renamed... these will give you function not found errors in T2.

There is a compatability include file in the basenote for T2.0 that you can use that should allow all your T1 scripts to run without modification in T2, but will give you console warnings when it uses deprecated functionality.

Dale

Edit: added more info...

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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