The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "SAVEAS"
Line 48: | Line 48: | ||
SAVEAS TYPE=EXTRACT FOLDER=* FILE=* | SAVEAS TYPE=EXTRACT FOLDER=* FILE=* | ||
+ | |||
+ | '''Extract some text''' (e. g. the title) of a report '''and use it as file name''': | ||
+ | |||
+ | TAG POS=1 TYPE=B ATTR=TXT:* EXTRACT=TXT | ||
+ | SAVEAS TYPE=CPL FOLDER=d:\reports FILE=report_{{!EXTRACT}}.htm | ||
+ | |||
+ | So if the extracted text is "Sales Report January 2011" the page will be saved as ''report_Sales Report January 2011.htm''. | ||
=== Related forum posts: === | === Related forum posts: === |
Revision as of 11:21, 4 January 2011
Saves information to a file. The SAVEAS command can save different information to a file. You can add parts to the original file name by using the + syntax (see Examples). The built-in variable !NOW is helpful in this context.
Syntax
SAVEAS TYPE=(CPL|MHT|HTM|TXT|EXTRACT|BMP|PNG) FOLDER=folder_name FILE=file_name
Note:
- The MHT format is only supported in the iMacros Browser and IE (Microsoft specific format).
- Taking Screenshots: The TYPE=BMP screenshot is not yet supported in Firefox, instead Firefox supports the PNG format. The TYPE=PNG screenshots is not yet supported in the iMacros Browser/IE, but the BMP format is supported instead. Currently only the iMacros Browser and iMacros for IE can take screenshots of non-HTML content like Flash and Silverlight.
Parameters
- TYPE
- Specifies the type of the save information. The following options are available:
- CPL
- The complete web page is saved. The files and images are saved separately and stored in a folder.
- MHT
- The web page plus images are saved in a single file (Web Archive).
- HTM
- The web page source is saved with no images. If the page has frames, all framed HTML pages are saved automatically.
- TXT
- Only the web page text is saved; all HTML tags are omitted.
- EXTRACT
- The value of the variable !EXTRACT is saved in CSV format.
- Note: the value of the !EXTRACT variable is reset after calling "SAVEAS TYPE=EXTRACT".
- BMP (iMacros Browser, supports Flash, Flex and Silverlight)
- A screenshot of the web page is saved. If used in the iMacros Browser the complete web page (including the invisible part below the fold) is saved. If used inside Internet Explorer only the visible part of the web page is saved. Note: In the iMacros Browser we recommend to use TAB=1 for the screenshots, on other tabs a page refresh is done by iMacros before it takes the screenshot. This might cause problems with some web applications (This issue will be fixed ASAP, but please note that everything works ok if you use the first tab for the screenshot).
- PNG (iMacros for Firefox, only)
- as above: a screenshot of the web page is saved
- FOLDER
- Specifies the folder in which the file is saved. Use * for the standard download folder specified in the Paths tab of the Options dialog, e.g. C:\Program Files\iMacros\downloads\. Note that blank spaces in the path need to be replaced by "<SP>" like in "c:\my<SP>folder" (instead of "c:\my folder")
- Note: For changing the folder location when when taking a screenshot, use an ONDOWNLOAD command before the SAVEAS.
- FILE
Specifies the file name under which the file is saved. If no file extension is given then the default file extension is used. If you use FILE=*, the default file name extract.csv is used. Use +something to add something to the original file name before the file extension.
Examples
Save the current webpage in a file called homepage_current.mht
SAVEAS TYPE=MHT FOLDER=* FILE=homepage_current
Save a screenshot of the current page with the current date in the original filename
SAVEAS TYPE=BMP FOLDER=C:\Screenshots FILE=+{{!NOW:ddmmyyyy}}
Save extracted text to default file ("extract.csv" in iMacros "Downloads" folder).
SAVEAS TYPE=EXTRACT FOLDER=* FILE=*
Extract some text (e. g. the title) of a report and use it as file name:
TAG POS=1 TYPE=B ATTR=TXT:* EXTRACT=TXT SAVEAS TYPE=CPL FOLDER=d:\reports FILE=report_Template:!EXTRACT.htm
So if the extracted text is "Sales Report January 2011" the page will be saved as report_Sales Report January 2011.htm.