
Is there a way to have time remaining also be part of the text color and size.This…tell application "QDisplay"set timeRemaining to 60set message to "Showtime in..." & timeRemainingset messageSize to 50set messageColor to "red"end tellProduces this… (with the red text static and the small white text counting down).
Hi Team,
And:
>set messageColor to ““
produces an AppleScript-error “-609”, as text: “Connection not allowed. (?)” and a full breakdown of QDisplay.
I assumed, it would reset the color to a default setting.
Regards…
…Maik Waschfeld
But you can use a AppleScript countdown/alarm I Created to make it look like this where the text change color depending on the current time is <= alarmTime.Is it something what you can use?
set messageColor to "black"
set messageColor to "white"
set messageColor to "red"
set messageColor to "green"
set messageColor to "blue"
set messageColor to "cyan"
set messageColor to "magenta"
set messageColor to "yellow"
and the color name must all be in lowcap with "". So to set it to default use set messageColor to "white"
// Mathias
--
--
Change your preferences or unsubscribe here:
http://groups.google.com/group/qlab
Follow Figure 53 on Twitter: http://twitter.com/Figure53
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/9539233b-b5c6-4675-9d4e-425bfb9c7ac6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Add a delay just above theend repeatand this should be much easier on our core.
-- NB: this script loops indefinitely; you need to implement it in such a way that you can stop it!-- Declarationsset userAlarmTime to "19:30:00" -- Time format subject to localisation settingsset userMessageString to "Time to alarm…"set userTextDelimiter to return -- What should go between the userMessageString and the countdown, eg: space, returnset userBeforeColour to item 2 of availableColours -- Colour of message before alarmset userAfterColour to item 3 of availableColours -- Colour of message after alarmset userMessageSize to 48property availableColours : {"black", "white", "red", "green", "blue", "cyan", "magenta", "yellow"} -- All colours in QDisplay-- Main routineset alarmTime to date userAlarmTime of (current date) -- Asking for current date inside a tell block adds overhead (error -10004)tell application "QDisplay"set messageSize to userMessageSizeset messageColor to userBeforeColourend tellset colourChanged to falserepeat
set secondsRemaining to alarmTime - (current date)
if secondsRemaining > 0 thenset timeString to "-" & my makeHHMMSS(secondsRemaining)elseset timeString to "+" & my makeHHMMSS(-secondsRemaining)if not colourChanged thentell application "QDisplay" to set messageColor to userAfterColourset colourChanged to trueend ifend if
tell application "QDisplay" to set message to userMessageString & userTextDelimiter & timeString
delay 0.5 -- Less than 1 second allows the counter to get closer to realtime
end repeat-- Subroutineson makeHHMMSS(howLong)set howManyHours to howLong div 3600set howManyMinutes to howLong mod 3600 div 60set howManySeconds to howLong mod 60 div 1return padNumber(howManyHours, 2) & ":" & padNumber(howManyMinutes, 2) & ":" & padNumber(howManySeconds, 2)end makeHHMMSSon padNumber(theNumber, minimumDigits)set paddedNumber to theNumber as textrepeat while (count paddedNumber) < minimumDigitsset paddedNumber to "0" & paddedNumberend repeatreturn paddedNumberend padNumber