Command Line - SAVEAS window size in -silent mode?

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
pe2850
Posts: 2
Joined: Sat Jan 19, 2019 3:26 pm

Command Line - SAVEAS window size in -silent mode?

Post by pe2850 » Sat Jan 19, 2019 4:21 pm

I'm trying to create a macro that can be run from command line with the -silent flag, the macro should load a webpage report and save it as a PNG image.

I'm able to get it work fine in interactive mode, but when i run it from the command line with the -silent flag, the output size of the image is 400x300px; When running in interactive mode it is 1641x902px.

Script:

Code: Select all

URL GOTO=https://www.****
'TAG POS=1 TYPE=FONT ATTR=TXT:Reports
WAIT SECONDS=2
SAVEAS TYPE=PNG FOLDER=\Downloads FILE=TFReport
My command line is fairly simple:

Code: Select all

imacros -macro TReport -silent
I've tried setting the size to something such as :
SIZE X=1200 Y=1024
But this has no impact on the size. Is it possible to set the size, or is there a better way to do this? I would be OK having it printed to a PDF or similar, but that seems like much more work to implement...
User avatar
The iMacros Guru
Posts: 25
Joined: Tue Mar 07, 2017 11:07 pm
Contact:

Re: Command Line - SAVEAS window size in -silent mode?

Post by The iMacros Guru » Mon Jan 21, 2019 7:04 pm

This is a long-running issue that has existed with the iMacros browser going all the way back to version 7.10.

There is no permanent fix that I am aware of, but one way to work around the issue would be to temporarily make the browser visible when taking the screenshot by calling the TRAY SHOW|HIDE command, for example:

Code: Select all

URL GOTO=https://www.****
'TAG POS=1 TYPE=FONT ATTR=TXT:Reports
WAIT SECONDS=2
TRAY SHOW
SAVEAS TYPE=PNG FOLDER=\Downloads FILE=TFReport
TRAY HIDE
Of course, this makes the browser visible briefly and may not be a desired workaround. In that case, another option is available if you are using the Enterprise Edition. You would need to create a separate user account on the machine just for running macros, and then use the iMacros scripting interface combined with the iimRunner tool to launch the browser and play the macro in that account, therefore nothing is ever displayed in the 'primary' user account where the script/command-line is run. Or, if you don't need to launch the macro manually from the 'primary' account and only wish to run it via a scheduled task, then you only need the Professional Edition to be able to do this.
pe2850
Posts: 2
Joined: Sat Jan 19, 2019 3:26 pm

Re: Command Line - SAVEAS window size in -silent mode?

Post by pe2850 » Mon Jan 21, 2019 7:51 pm

Thank you for the answer, would i still need to set the SIZE command, or would it set size appropriately?
User avatar
The iMacros Guru
Posts: 25
Joined: Tue Mar 07, 2017 11:07 pm
Contact:

Re: Command Line - SAVEAS window size in -silent mode?

Post by The iMacros Guru » Mon Jan 21, 2019 8:08 pm

I'm not sure entirely, go ahead and experiment with it and see what results you get.
Post Reply