Conditional SAVEAS

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
Post Reply
chivracq
Posts: 7717
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional SAVEAS

Post by chivracq » Wed Aug 08, 2018 4:22 am

halenrauch wrote:Hi,

I am looking for a piece of code performing a
SAVEAS command only if the length of text to be stored exceeds a predefined threshold
(the length of text is an indicator for whether the EXTRACT is of interest to be stored, at all).

I would guess that the piece of code could roughly look like following line:

SET !VAR4 EVAL("var s='{{!EXTRACT}}'; if(s.length < 5000){var x=\"\";}else{SAVEAS TYPE=EXTRACT FOLDER=E:\\username FILE=filename.csv};")

There are parallels to
viewtopic.php?f=2&t=27599&p=74301&hilit=length#p74301

However, I am still not firm enough in iMacros and JavaScript for creating runnable code starting from this and my sketchy ideas.

The searched piece of code should work at least on iMacros for FF 9.0.3, FF 55.0.3 (32-bit), and Win 7 Version 6.1.
Fake User doing C&P of some older Post..., from Vietnam of course...!

[halenrauch] [222.252.25.140] [Vietnam]

Original Post:
- Conditional SAVEAS

Thread has been reported to be deleted + User & IP to be banned... :roll:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply