Page 1 of 1
opening a diferent card based on day of the week
Posted: Sun Sep 05, 2010 4:21 am
by magice
I have a stack with 7 cards. I need a script that will look at the day of the week it is when the stack is opened, and go to a specific card based on that data. i have been trying to use the date function to get the data i need, but I have so far been unsuccessful. How can I sort the day portion of the data from the rest of the date?
Re: opening a diferent card based on day of the week
Posted: Sun Sep 05, 2010 8:59 am
by jmburnod
Hi Magice,
if i understand what you want this script should work
Code: Select all
on openstack
GoCdTheDay
end openstack
on GoCdTheDay
put the long date into TheDate
put item 1 of TheDate into TheDay
put TheDay
open cd TheDay
end GoCdTheDay
Best
Jean-Marc
Re: opening a diferent card based on day of the week
Posted: Sun Sep 05, 2010 7:34 pm
by magice
thank you, that put me on the right path. However it still has one unexpected problem in my situation. Each of my cards is tied to a tab menu group so I can switch "days" manually by clicking the tabs. The script changes each card, but the tab menus hilight doesn't follow.
I have tried the following script to rectify this:
Code: Select all
set the hilitedButton of group "Days" to TheDay
(Group "Days" being my tab menu) I recieved an error that TheDay was not an integer
so I tried the following script:
Code: Select all
if the value of TheDay = "Monday" then put 1 into tDayNum
else end if
if the value of TheDay = "Teusday" then put 2 into tDayNum
else end if
if the value of TheDay = "Wednesday" then put 3 into tDayNum
else end if
if the value of TheDay = "Thursday" then put 4 into tDayNum
else end if
if the value of TheDay = "Friday" then put 5 into tDayNum
else end if
if the value of TheDay = "Saturday" then put 6 into tDayNum
else end if
if the value of TheDay = "Sunday" then put 7 into tDayNum
else end if
put tDayNum
set the hilitedButton of group "Days" to tDayNum
but it isn't working either. Any idea how to get the Tab Menu to follow the cards the same way the cards follow the tab menu?
Re: opening a diferent card based on day of the week
Posted: Sun Sep 05, 2010 9:01 pm
by Mark
deleted by poster
Re: opening a diferent card based on day of the week
Posted: Sun Sep 05, 2010 9:04 pm
by bn
Magice,
look at the menuhistory in the dictionary. You can switch the tab at the same time you switch to the card or you could just set
Code: Select all
set the menuHistory of button "Tab Menu" to tDayNum
where tDayNum is a number which corresponds to your Tab Menu. This switches to the card. So you would not issue a go to card x but just change the menuhistory of the Tab Menu. By the way you can also query the menuhistory of the tab menu to know which is the active tab.
regards
Bernd
Re: opening a diferent card based on day of the week
Posted: Sun Sep 05, 2010 9:20 pm
by magice
Once again Bernd you saw past my poor descriptions got to the root of the problem.
Thank You