Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 5 made on Thursday July 28, 2016 at 14:59
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
On July 28, 2016 at 14:04, DavidinCT said...
After tweaking my macros a little, that worked perfect. Thank you.

What you did makes sense as I go through it, I am not a writer but, in IT for over 20 years so I do understand some fundamentals of it.

This gets me over the major milestones on my build, now it's about creating pages for each device.

Thank you again for your help !!!!

Great to hear. Also, not so much for what you're doing here, but in general I do recommend keeping as much ProntoScript at the Activity (Device) level as possible, then referencing to it when needed at the Page/Button level. Updated example below.

Activity (Device) Level:
function doPowerOff() {
CF.widget('ALL_OFF', 'POWER', 'PS_MACROS').executeActions();
}
//
function doPowerOn() {
CF.widget('ALL_ON', 'POWER', 'PS_MACROS').executeActions();
}

On the button itself:
var counter = 0;
onHold = function() {
counter++; if (counter==1) { doPowerOff(); }
}
onHoldInterval = 1000;
onRelease = function() {
if (counter==0) { doPowerOn(); }
}

I always limit the amount of ProntoScript used at the Page/Button level when possible. Keeping the majority of your ProntoScript at the Activity (Device) level makes it easier to work with. Following this practice is especially helpful in cases where the same ProntoScript is used in different places at the Page/Button level. Takes far less time to update something at the Activity (Device) level once than hunting down and updating each instance at the Page/Button level instead.

Last edited by Lowpro on July 29, 2016 09:10.
LP Related Links:
View my profile to access various
links to key posts and downloads.


Hosting Services by ipHouse