Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Fri Jan 24, 2020 7:39 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Reading Specific Day Variable?
Thanked: 0 time(s)  Unread post Posted: Sat Jan 11, 2020 1:48 pm 
New User
New User



Joined: Wed Sep 05, 2012 12:37 pm
Posts: 21
Been thanked: 2 time(s)
Has thanked: 6 time(s)
Contribution Points: 15
Hi, is there an easy way to see if the day is a Saturday or Sunday? Have been using the "Get Time And Date" macro. Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Reading Specific Day Variable?
Thanked: 1 time(s)  Unread post Posted: Sun Jan 12, 2020 7:08 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1988
Location: USA
Been thanked: 442 time(s)
Has thanked: 34 time(s)
Contribution Points: 16858
An easy way ?? … not that I know of. We don't have Instructions or Criteria to automatically tell you that.

However, you can script it. There are algorithms online that you can use to calculate the day of the week; you'll just need to script it. As an example here is one for this month:
Code:
 begin
     //    System.Get date and time("", "", "x", "", "", "")
     Variable.Set("x", "26")
     begin loop()
          if  Variable.Is less than (Math)("x", "8")
               begin
                    Macro.Break from loop("no")
               end
          if  Variable.Is greater than (Math)("x", "7")
               begin
                    Variable.Subtract (Math)("x", "7")
               end
     end
     if  Variable.Is equal to("x", "4")
          begin
               Window.Display message box("The day is a Saturday", "yes")
               Macro.Abort()
          end
     if  Variable.Is equal to("x", "5")
          begin
               Window.Display message box("The day is a Sunday", "yes")
               Macro.Abort()
          end
     Window.Display message box("The day is not a Saturday or Sunday", "yes")
 end
It's using variable.set instead of date/time so you can test it with any day this month. To use it with date/time, uncomment the date/time part and delete the variable.set. You can also delete the macro.abort(s) when using date/time unless you want to know if it was not a Saturday or Sunday...you can delete that part also.

If you wanted to use the script above, every month you would need to change the numbers for the first Sat and Sun; For Feb Sat would be 1 and Sun 2... or script that too so it's automatic.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: Reading Specific Day Variable?
Thanked: 0 time(s)  Unread post Posted: Sun Jan 12, 2020 6:04 pm 
New User
New User



Joined: Wed Sep 05, 2012 12:37 pm
Posts: 21
Been thanked: 2 time(s)
Has thanked: 6 time(s)
Contribution Points: 15
Ok thanks for reply Syrifina will try that.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group