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 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
chivracq
Posts: 8430
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