Countdown to specific Date and Time

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

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.

Countdown to specific Date and Time

by Jimlaro30 on Tue Feb 13, 2018 2:08 pm

Hello. I 've been searching the internet but i couldn't find an answer to this. Is it possible to create a countdown to a specific date and time inside imacros? I know that this can be done by scheduling in windows to run the .bat file but this is not helpfull because it first launches firefox and then runs the macro and this can take a few seconds. I want this to be integrated inside the imacro and running all the way until the specific date and time and then continue executing the remaining script. Thank you in advance!
Jimlaro30
 
Posts: 1
Joined: Tue Feb 13, 2018 1:57 pm

Re: Countdown to specific Date and Time

by chivracq on Tue Feb 13, 2018 3:26 pm

Jimlaro30 wrote:Hello. I 've been searching the internet but i couldn't find an answer to this. Is it possible to create a countdown to a specific date and time inside imacros? I know that this can be done by scheduling in windows to run the .bat file but this is not helpfull because it first launches firefox and then runs the macro and this can take a few seconds. I want this to be integrated inside the imacro and running all the way until the specific date and time and then continue executing the remaining script. Thank you in advance!

FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for FF v...?, FF v...?, OS=Win v...?

Hum..., "... searching the internet...", => searching the Forum might prove to be more efficient...! :idea:

But to answer your Qt, => yep possible, and there are several ways... and several related Threads already on the Forum :D
And this can easily be done in pure '.iim', so there is nothing really specific to "iMacros for FF" I would think, unless you are using a '.js' Script, which you then should have mentioned if that's the case... => Correct Sub-Forum would have been the 'General' one from the scarce Info you provide about what your Macro will be doing... (But no need to duplicate now...)
- (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...
chivracq
 
Posts: 6687
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Countdown to specific Date and Time

by chivracq on Wed Feb 14, 2018 1:47 pm

For those interested, parallel Thread on SOF...
Same "low" Quality Thread (no Research, FCI not mentioned, etc...), but Advanced User @Shugar has already posted one Solution... :wink:
@Shugar wrote:Just as an example, you can try something like this code:
Code: Select all
' ... '
SET specificTime "2018-02-14T12:00:00"
SET countdownTime EVAL("var ct = parseInt((new Date('{{specificTime}}') - new Date()) / 1000); Math.max(0, ct);")
WAIT SECONDS={{countdownTime}}
' Happy Valentine’s Day! '

Interesting/useful Example on how to use/manipulate a 'Date' Object in JS, but not the most "accurate" Solution for OP as it relies solely on the iMacros 'WAIT' Command which is not always very accurate, but it should do "the Job" for say, up to 1 hour in advance maybe... 8)
- (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...
chivracq
 
Posts: 6687
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot] and 12 guests

-->