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

Login:
Pass:
 
 

Topic:
link a button prontoscript
This thread has 7 replies. Displaying all posts.
Post 1 made on Monday December 24, 2018 at 17:03
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
Hi,is it really impossible
to link a button that includes prontoscript or is there any way to do this?
I‘ve tried it but no success.
I‘ve read here in the forum that it‘s only possible to link a button that calls an action list.
Merry Christmas to all,
Fischi
Post 2 made on Tuesday December 25, 2018 at 20:27
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
You are correct, the Link action is not able to execute any ProntoScript that may reside on the target button. Additionally, the Link action will only execute the Action List of the target button in cases where the target button doesn't have ProntoScript enabled. That being said, there is a way to accomplish something similar to the Link action, but for ProntoScript. How is this done one might ask? Well, through the use of more ProntoScript naturally. :-P

If you place ProntoScript within the label of a Panel or Button (tagged accordingly) you can then reference that ProntoScript at any time throughout your configuration file from other ProntoScript using the eval() function.

I do this quite a bit with my configuration file. Any ProntoScript that I use repeatedly throughout my configuration file I'll consolidate in one place, then reference as needed using the eval() function.

Below is an example of how I reference the ProntoScript I use for checking the power and volume status of my home theater receiver. The ProntoScript includes displaying the appropriate speaker symbol and volume level within the GUI.

eval(CF.widget("doGetStatus","psGetStatus","Macros (Bridge)").label);

The ProntoScript for checking the power and volume status of my home theater receiver resides on the label of a Panel with the PS tag, "doGetStatus", on a page with the PS tag, "psGetStatus" under a device with the PS tag, "Macros (Bridge)". The above eval() function is then used throughout my configuration file any time I want to check on the status of my home theater receiver, i.e. execute the ProntoScript on the label of the Panel.

Last edited by Lowpro on December 25, 2018 21:02.
LP Related Links:
View my profile to access various
links to key posts and downloads.
OP | Post 3 made on Wednesday December 26, 2018 at 05:35
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
Thanks, Lowpro
you pointed me in the right direction so it may be possible that I can finish my
project with success.
Merry Christmas and all the best wishes for 2019 for all !
Fischi
Post 4 made on Tuesday January 8, 2019 at 11:22
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
The javascript eval function is considered "dangerous" by many "elite" Javascript programmers. For those of you not familiar with "eval"; it takes as an argument a string (including very very long strings), compiles it and then executes it. Naturally, the string must be syntactically correct javascript otherwise an error is thrown. The danger is reading in a string from an unknown source and blindly doing an eval on it. I use eval, Lyndell uses eval, Lowpro obviously does . . . Just don't blindly eval an unknown string
Post 5 made on Thursday January 10, 2019 at 22:52
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
On January 8, 2019 at 11:22, Barry Gordon said...
The javascript eval function is considered "dangerous" by many "elite" Javascript programmers. For those of you not familiar with "eval"; it takes as an argument a string (including very very long strings), compiles it and then executes it. Naturally, the string must be syntactically correct javascript otherwise an error is thrown. The danger is reading in a string from an unknown source and blindly doing an eval on it. I use eval, Lyndell uses eval, Lowpro obviously does . . . Just don't blindly eval an unknown string

Great advice!

And thanks again Barry for exposing me to the joys of ProntoScript back in the day. Our time working together on that SlimPronto activity is in large part responsible for my eventual transition from a purely WYSIWYG approach with PEP to one more focused on the use of ProntoScript. Loving my Pronto's more than ever and a big reason why is due to the things I continue to be able to accomplish through the use of ProntoScript.
LP Related Links:
View my profile to access various
links to key posts and downloads.
Post 6 made on Friday January 11, 2019 at 03:42
Twelfth Monkey
Long Time Member
Joined:
Posts:
November 2016
116
I'd love to get my head around it, but it looks daunting to someone with no programming background!
Post 7 made on Friday January 11, 2019 at 04:19
buzz
Super Member
Joined:
Posts:
May 2003
4,366
One point to keep in mind is that eval() is not quite as efficient at execution time as fixed code. For example if we declare a function “sum(a, b)”, “c = sum(d, e)” will execute slightly faster than “eval( ‘c = d + e’ )” because the argument for eval() is a string that must be fully parsed for each execution while sum() only needs to be parsed as the program is loaded. This difference hardly matters if the eval() is executed infrequently, but could be a drag if placed inside of a heavily used loop.

Please note that I’m not trying to make a huge deal out of this. Any project is a compromise between development time, ease of maintenance, memory use, and execution time. In the early days of 1k (or less) RAM and one megahertz processors, we carefully crafted our memory use and run times. We had virtually no run time error checking because we didn’t have enough space and extensive error checking might require more time than the event than we were attempting to react to and control. Now, we have multi Gigahertz processors and don’t blink if there are many megabytes of operating system resources tied up with displaying or printing “Hello World”.
Post 8 made on Sunday January 13, 2019 at 15:09
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
For LowPro and others who love their Pronto's because of Prontoscript (Javascript):

I still use my Prontos to control TV's in my home and the UI for my Home Theater is a Pronto 9800 driving a PC instead of extenders. I have never used the Philips extenders but rather Global Cache IP2IR devices.

For the Automation in my home, I use iPads/iPhone running the Command Fusion system of guiDesigner and iViewer. guiDesigner is analogous to PEP2 and iViewer is the run time system for IOS, and there is one for Android (Beta). guiDesigner runs on a PC (almost any version of windows) building the file that is loaded into the iPad and interpreted by iViewer. As with the Prontos, there is a full system for dealing with the product not using Javascript, but the product is tightly coupled to a Javascript engine. I do all my work in Javascript for the iPads and use a Raspberry Pi programmed in Node.js as my home's central controller. The RPi handles such things as CallerID and voice synthesis (TTS). If I need true IR I just use a Global Cache IP2IR device.
The transition from Prontoscript and graphics on the Pronto to Javascript and graphics on the iPad with Command Fusion was not that bad, in fact, it was fun!


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse