Support
All support resources for our products. Here you can find answers to frequently asked questions, discuss with other users, recover a lost license code or file a support request.
Forum closed
This forum was closed and turned into an archive effective April 21, 2018. It is no longer possible to create new topics or reply to existing topics.

Thanks everyone for all the great questions and contributions over the years.

Please use the Contact form to get in touch.

Remote Buddy Forum

Overview 

AuthorThread
User

13.05.2007 07:19:10
Re: arrays

This posting is older than 6 months and can contain outdated information.
In case anyone's interested in this topic, I'll say that I hit upon a solution. Remote Buddy does not like to see multiple menureturn handlers in a single script, so the way to do this is to have different bits of script generate the dynamic content (in this case, all artists, albums and playlists from iTunes) and then combine them all into one huge arra - keeping in mind Felix's advice above on creating/combining arrays, to make sure that everything is properly nested within brackets.

The problem with that is that to create nested groups of dynamically-generated data, the script has to run doxens of repeat loops within dozens of repeat loops. My iTunes library has hundreds of artists and albums, so all those repeat loops mean a menu won't show up for 30 seconds or so. Not ideal.

The solution is to set up a separate script to generate the huge array and write it to a text file (not unlike the way iTunes itself uses an XML file for itw own data). Attach it to a daily iCal alarm to update every night. Then in the Remote Buddy script, simply write a few lines telling Finder to read the data in the text file as a list, and run a showmenu command with the resulting (global) variable as the items. The menu pops up instantaneously and functions normally. 

Thread-display::