From iMacros
(Redirected from iimGetLastExtract)
Jump to: navigation, search

Name change: Please use iimGetExtract instead. See API enhancements for details.

Returns the contents of the !EXTRACT variable. If the last command was iimPlay and if EXTRACT is used inside a macro iimGetLastExtract returns the extracted text. If the EXTRACT command could not find the extraction anchor then an #EANF# (Extraction Anchor Not Found) message is returned. If there is no EXTRACT command in the macro which was just played then iimGetLastExtract returns an empty string ("").

If in one macro several EXTRACT commands appear then the results are separated by the string [EXTRACT]. If complete tables where extracted, adjacent table elements are separated by the string #NEXT# and ends of table rows are delimited by the string #NEWLINE#.


String extract = iimGetLastExtract ( [int index_of_extracted_text]   )


Since version 6 this command supports the option to return the extracted information separately, so no further parsing and splitting is required:

iimGetLastExtract () - returns all extracted information at once

iimGetLastExtract (0) - returns all extracted information at once

iimGetLastExtract (1) - returns 1st extracted data

iimGetLastExtract (2) - returns 2nd extracted data (and so on)


Display the extracted results from a macro (Visual Basic Script example):

Dim imacros, iret 
Set imacros = CreateObject("imacros") 
iret = imacros.iimInit() 
iret = imacros.iimPlay("myextractmacro") 
MsgBox "The extract was: "+ vbNewline + _ 
iret = imacros.iimExit()

See Also

Related forum posts:

iimInit, iimPlay, iimDisplay, iimExit, iimGetLastError, iimTakeBrowserScreenshot