View unanswered posts | View active topics It is currently Wed Jun 19, 2013 6:07 pm



Reply to topic  [ 8 posts ] 
 Time Display on web site 
Author Message

Joined: Apr 29, 2012
Posts: 16
Post Time Display on web site
Hello, i am trying to get the time to show up as a variable so i can have it on indigo both the touch app and the web site. After perusing around the forum it seems applescript is the best way but i cant seem to get this to work. i created a variable in indigo called CurrenTime and im trying to create an action to run a script every minute to update this variable. i cant quite seem to get the syntax right. coudl someone help me out or tell me of a better way to do this if possible? i looked on both the forums and online for sample code but so far it just wont work... thank you!


Tue Jun 05, 2012 12:37 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6859
Location: Austin, Texas
Post Re: Time Display on web site
Use the Insert Timestamp into Variable action in the Action Collection plugin. If you want the time formatted with 12 hour with am/pm then the formatting string would be "%I:%M %p" (i.e. "03:45 PM").

_________________
Jay (Indigo Support)
Image


Tue Jun 05, 2012 1:21 pm
Profile WWW

Joined: Apr 29, 2012
Posts: 16
Post Re: Time Display on web site
Thank you! worked Perfectly!


Tue Jun 05, 2012 8:18 pm
Profile

Joined: Oct 28, 2007
Posts: 301
Post Re: Time Display on web site
I just tried this, but the time [on the website] is not auto-updating. I only get the current time when I click on the control page item.

Also, is there a string for 2:45, instead of 02:45 when there is a single digit hour [no am/pm]?


Tue Jun 12, 2012 3:56 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6859
Location: Austin, Texas
Post Re: Time Display on web site
Is the time updating in the Variable window? If not your trigger isn't working. If it is then the page element on your control page isn't defined correctly.

The built-in Python time functions don't appear to have a 0 free hour so you'd have to write a script to take off the leading 0 rather than using the Insert Timestamp into Variable action.

_________________
Jay (Indigo Support)
Image


Tue Jun 12, 2012 4:10 pm
Profile WWW

Joined: Oct 28, 2007
Posts: 301
Post Re: Time Display on web site
jay (support) wrote:Is the time updating in the Variable window? If not your trigger isn't working.

NOT updating in the variable window, only when I click on the control page item.

Assuming that I need a trigger in Indigo, what are the "Trigger/Condition/Actions" settings suppose to be?


Tue Jun 12, 2012 4:35 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6859
Location: Austin, Texas
Post Re: Time Display on web site
Create a schedule that fires every minute. No conditions. The action is the Insert Timestamp into Variable action in the Action Collection plugin. That will cause the variable to update once a minute. Then put a variable value page element on your control page that shows the value of the variable that you selected in the Insert Timestamp into Variable action.

_________________
Jay (Indigo Support)
Image


Tue Jun 12, 2012 4:50 pm
Profile WWW

Joined: Oct 28, 2007
Posts: 301
Post Re: Time Display on web site
Got it, Thanks :D


Tue Jun 12, 2012 5:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot 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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.