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

08.01.2012 04:16:22
Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
Hi,

 
I have been playing with Remote Buddy Express for a few weeks now and I am really interested in using it in an upcoming project where I am incorporating a mac mini into an A/V and home automation system.

I have already integrated it to work with an iOS based 'universal remote' system called Redeye. The Redeye allows me to send IR commands to all of my A/V components (including the mini) and IP control other network based devices. Here is a list of the capabilities that this integration has produced... I'll go into more detail later if anyone is interested:

-I globally remapped a long press of apple remote's Menu button to perform a series of IR commands that turns on the TV, Receiver, set everything to the right input, and launches RBE's main menu

-I created a button on one of the Redeye's layouts that can instantly launch any applescript or item on the RBE's menus.

-I created a behavior that remaps the buttons on my apple remote to control an A/V component like a DVD player.

-I have figured out how to use applescript to query a itunes playlist and spit the results back into a remote button menu, then play a track when its selected

My goal is to create a 2-tiered approach for controlling everything. One being an 'apple remote control' that can basically remap its buttons to whatever software OR hardware one is using. And two, a Redeye layout for the mini that allows me make the mini do whatever I want with the help of RBE. For example, I will have a Redeye button and a RBE menu item for Pandora that: launches Safari, opens pandora.com, sets Safari to fullscreen, and remaps the button of the apple remote / redeye layout to control the receivers volume, and pandora's next and thumbs up/down controls. You might use the apples remote if you wanted the more tactile, lean-back experience and the Redeye layout if you wanted to have more capability and/or the range of wifi.

Anyway, I have run into some problems and I'm hoping you can help:

 
1. Is there any way to remotely launch a specific RBE menu (like iTunes>Playlist) via XMLhttpRequests.... I figured out how to launch the items on the manus (via AJAX remote) but not the menus themselves. I am trying to make the iTunes playlists more accessible by adding an item on the main menu the jumps into a specific playlist and I can't figure it out... I made applescript app that asks for a playlist tracks and creates an RBE menu out of them works but when I do it with a playlist internet radio stations it gets all screwed up and does not list all of them.. but it work fine on the RBE 'Browse Music so it would be great if I could just launch the RBE's

iTunes>Playlist Menu

 
2. What approach would you suggest for creating behaviors to control hardware like a DVD player. I am currently creating a behavior and associating it with the RBE app which is causing problems. Can I associate a RBE activity with an applescript app? Maybe that is a cleaner approach?

 
3. What approach would you suggest to create behavior profile for control browser based apps like Pandora? Do I just associate the behavior with Safari and give it a greater priority number?

 
4. Is there any way to control the sort order of RBE's output for the files in my Movies folder... I'm pretty sure you can use applescript to query the finder but I'm trying to stay in RBE native menu system?

 
Thanks,

 
Christian

These entries from the FAQ may be relevant to this topic:

Behaviours - Support for iTunes® & AirPlay®
Configuration
Hardware - Apple® Remote
Hardware - iPhone™ / iPod® touch / AJAX Remote
User

12.01.2012 10:54:02
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
Thanks for asking.

1. Is there any way to remotely launch a specific RBE menu (like iTunes>Playlist) via XMLhttpRequests.... I figured out how to launch the items on the manus (via AJAX remote) but not the menus themselves. I am trying to make the iTunes playlists more accessible by adding an item on the main menu the jumps into a specific playlist and I can't figure it out... I made applescript app that asks for a playlist tracks and creates an RBE menu out of them works but when I do it with a playlist internet radio stations it gets all screwed up and does not list all of them.. but it work fine on the RBE 'Browse Music so it would be great if I could just launch the RBE's

iTunes>Playlist Menu

 
Unfortunately, I can't think of a way to do this.

2. What approach would you suggest for creating behaviors to control hardware like a DVD player. I am currently creating a behavior and associating it with the RBE app which is causing problems. Can I associate a RBE activity with an applescript app? Maybe that is a cleaner approach?

 
It depends on what you want to do. If all you want is to create one Behaviour per device you want to control, the correct approach is to not associate the Behaviour with any application, but instead create an extra action and assign it as action to execute when the Behaviour gets activated. That extra action should contain an AppleScript actor with this code - which will make your Behaviour remain active until you explicitely choose another Behaviour:

tell application "Remote Buddy" to behaviourcore accessor "setSticky" with stickyValue

Once that action is created, you can reuse it in all your Behaviours.

3. What approach would you suggest to create behavior profile for control browser based apps like Pandora? Do I just associate the behavior with Safari and give it a greater priority number?

 
I'd suggest the same approach as 2), but add a few extra lines of code to the activation AppleScript that opens the web service's URL in Safari - or brings any Safari window into focus that already has that URL loaded. I can't offer you AppleScript code for that, though.

4. Is there any way to control the sort order of RBE's output for the files in my Movies folder... I'm pretty sure you can use applescript to query the finder but I'm trying to stay in RBE native menu system?

 
There's currently no way to change that sort order.

Best regards, 
Felix Schwarz 

User

12.01.2012 23:26:56
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
Hi Christian,

I see that you were successful at: 
Using XMLhttpRequests to launch the items on the manus (via AJAX remote)

I was wondering how you did this? I am trying to implement similar IP control of RemoteBuddy.

Thanks for your help! 
Brett

User

13.01.2012 00:08:30
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
 
Thanks for asking.

1. Is there any way to remotely launch a specific RBE menu (like iTunes>Playlist) via XMLhttpRequests.... I figured out how to launch the items on the manus (via AJAX remote) but not the menus themselves. I am trying to make the iTunes playlists more accessible by adding an item on the main menu the jumps into a specific playlist and I can't figure it out... I made applescript app that asks for a playlist tracks and creates an RBE menu out of them works but when I do it with a playlist internet radio stations it gets all screwed up and does not list all of them.. but it work fine on the RBE 'Browse Music so it would be great if I could just launch the RBE's

iTunes>Playlist Menu

 
Unfortunately, I can't think of a way to do this.

 
Hi Felix,

Success! I was able to create an applescript that can queries an itunes playlist, spit the tracks back into a RB menu, and then play the selected track (or radio station). Its kind of a hack but it does the job ;)

--works inside remote buddy only 
--Must have iTunes playlist called "Internet Radio"

tell application "iTunes" 
set radio_list to name of (tracks of playlist "Internet Radio") 
set radio_list to radio_list & radio_list 
end tell

set radio_names_sorted to simple_sort(the radio_list)

tell application "Remote Buddy Express" 
showmenu with items radio_names_sorted menu name "example" 
end tell

on menureturn(hiddenID, menuname) 
tell application "iTunes" 
play track hiddenID of playlist "Internet Radio" 
end tell 
end menureturn

on simple_sort(my_list) 
set the index_list to {} 
set the sorted_list to {} 
repeat (the number of items in my_list) times 
set the low_item to "" 
repeat with i from 1 to (number of items in my_list) 
if i is not in the index_list then 
set this_item to item i of my_list as text 
if the low_item is "" then 
set the low_item to this_item 
set the low_item_index to i 
else if this_item comes before the low_item then 
set the low_item to this_item 
set the low_item_index to i 
end if 
end if 
end repeat 
set the end of sorted_list to the low_item 
set the end of the index_list to the low_item_index 
end repeat 
return the sorted_list 
end simple_sort

2. What approach would you suggest for creating behaviors to control hardware like a DVD player. I am currently creating a behavior and associating it with the RBE app which is causing problems. Can I associate a RBE activity with an applescript app? Maybe that is a cleaner approach?

 
It depends on what you want to do. If all you want is to create one Behaviour per device you want to control, the correct approach is to not associate the Behaviour with any application, but instead create an extra action and assign it as action to execute when the Behaviour gets activated. That extra action should contain an AppleScript actor with this code - which will make your Behaviour remain active until you explicitely choose another Behaviour:

tell application "Remote Buddy" to behaviourcore accessor "setSticky" with stickyValue

Once that action is created, you can reuse it in all your Behaviours.

 
Great... thanks for the tip. What application (if any) should I associate the constructed DVD behavior with? I think I remember needing to associate it with RB in order to get it to work when I was testing. Maybe I should create an applescript app that runs while i'm controlling the DVD player... any thoughts?

3. What approach would you suggest to create behavior profile for control browser based apps like Pandora? Do I just associate the behavior with Safari and give it a greater priority number?

 
I'd suggest the same approach as 2), but add a few extra lines of code to the activation AppleScript that opens the web service's URL in Safari - or brings any Safari window into focus that already has that URL loaded. I can't offer you AppleScript code for that, though.

 
Good idea... I'll look into this and post any results.

4. Is there any way to control the sort order of RBE's output for the files in my Movies folder... I'm pretty sure you can use applescript to query the finder but I'm trying to stay in RBE native menu system?

 
There's currently no way to change that sort order.

 
I was thinking that I might be able to query the Finder to spit back a list of the files in the Movie folder in newest to oldest and then do what I did above in the iTunes script... i'll look into it.

Thanks for your help!

Christian

 

 
Best regards, 
Felix Schwarz 
User

13.01.2012 00:36:18
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
 
Hi Christian,

I see that you were successful at: 
Using XMLhttpRequests to launch the items on the manus (via AJAX remote)

I was wondering how you did this? I am trying to implement similar IP control of RemoteBuddy.

Thanks for your help! 
Brett

Hi Brett,

This might sound a bit hackie but is works reliably and quickly once you get it in place

1. Turn on the 'Enable AJAX' (uncheck 'Require password' for now)

2. Use the Chrome browser to navigate to the AJAX Remote's web output at http://YOUR_IP:8888/

3. When you see remote right-click the page and select 'Inspect Element'

4. From Chrome's built in inspector select the 'Console' tab

5. Right-click into the white space in the Console and select 'Log XMLhttpRequests'

6. Now click on the AJAX Remote's 'Menu' botton and select what you are looging for... you will see the XMLhttpRequests in the console, they look like this: 
http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=goToRootLevel&offset=0&sid= (jumps you to the main menu) 
http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=select&offset=8&sid= (selects the 9th menu item of the main menu)

7. Now, depending on how and what you are doing... you send the sequence of XMLhttpRequests that select your desired command, have an unversal remote iOS app (Thinkflood's Redeye) that I'm using to send the right sequence of requests... it looks like this:

<a href="#" onclick="sendRequest('http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=goToRootLevel&offset=0&sid='); sendRequest('http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=select&offset=8&sid='); sendRequest('http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=select&offset=0&sid='); return false;"> Fullscreen iTunes<br>Visualizer</a>

_____________

Let me know if you have any additional questions,

Christian 

User

13.01.2012 00:37:04
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
 
Hi Christian,

I see that you were successful at: 
Using XMLhttpRequests to launch the items on the manus (via AJAX remote)

I was wondering how you did this? I am trying to implement similar IP control of RemoteBuddy.

Thanks for your help! 
Brett

Hi Brett,

This might sound a bit hackie but is works reliably and quickly once you get it in place

1. Turn on the 'Enable AJAX' (uncheck 'Require password' for now)

2. Use the Chrome browser to navigate to the AJAX Remote's web output at http://YOUR_IP:8888/

3. When you see remote right-click the page and select 'Inspect Element'

4. From Chrome's built in inspector select the 'Console' tab

5. Right-click into the white space in the Console and select 'Log XMLhttpRequests'

6. Now click on the AJAX Remote's 'Menu' botton and select what you are looging for... you will see the XMLhttpRequests in the console, they look like this: 
http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=goToRootLevel&offset=0&sid= (jumps you to the main menu) 
http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=select&offset=8&sid= (selects the 9th menu item of the main menu)

7. Now, depending on how and what you are doing... you send the sequence of XMLhttpRequests that select your desired command, have an unversal remote iOS app (Thinkflood's Redeye) that I'm using to send the right sequence of requests... it looks like this:

<a href="#" onclick="sendRequest('http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=goToRootLevel&offset=0&sid='); sendRequest('http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=select&offset=8&sid='); sendRequest('http://YOUR_IP:8888/Menu/menuEngine.rmbd?command=select&offset=0&sid='); return false;"> Fullscreen iTunes<br>Visualizer</a>

_____________

Let me know if you have any additional questions,

Christian 

User

13.01.2012 10:37:28
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.

Ok.... My roommate and I have gone a little nuts and have come up with a way display the contents of the Movies folder on a RB menu sorted by Date Modified that launches whatever file is selected in VLC. We have also added a 'folder action' to the Movies folder that updates the Date Modified of whatever files are added to it... end result: We have RB menu item that when clicked, always shows us the lastest files added to our Movies folder... crazy right?

Here is the applescript:

--works inside Remote Buddy

set files_list to do shell script "ls -t ~/Movies"

set myList to stringToList for files_list from (ASCII character 13) 
set menu_list to {} 
set _count to 1

repeat with theCurrentValue in myList 
set the end of menu_list to theCurrentValue 
set the end of menu_list to theCurrentValue 
end repeat

tell application "Remote Buddy Express" 
showmenu with items menu_list menu name "example"

end tell

on menureturn(hiddenID, menuname) 
tell application "Finder" 
set file_to_open to ((home as string) & "Movies:" & hiddenID) 
end tell 
tell application "VLC" 
activate 
open file_to_open 
end tell 
end menureturn

on stringToList for theString from stringDelimiter 
tell AppleScript 
set oT to text item delimiters 
set text item delimiters to stringDelimiter 
set outList to text items of theString 
set text item delimiters to oT 
return outList 
end tell 
end stringToList

__________________

And, here is the folder action:

on adding folder items to this_folder after receiving these_items 
tell application "Finder" 
try 
repeat with i from 1 to number of items in these_items 
set this_item to item i of these_items 
activate 
--display dialog "Doing it" 
do shell script "touch " & (quoted form of POSIX path of this_item) 
end repeat 
on error error_message number error_number 
if the error_number is not -128 then 
tell application "Finder" 
activate 
display dialog error_message & "touch" & (quoted form of POSIX path of this_item) buttons {"Cancel"} default button 1 giving up after 120 
--display dialog "touch " & (quoted form of POSIX path of this_item) 
end tell 
end if 
end try 
end tell 
end adding folder items to

User

13.01.2012 12:35:01
Re: Applescript, IP control, and integration with Thinkflood's Redeye and other A/V devices
View

This posting is older than 6 months and can contain outdated information.
 
It depends on what you want to do. If all you want is to create one Behaviour per device you want to control, the correct approach is to not associate the Behaviour with any application, but instead create an extra action and assign it as action to execute when the Behaviour gets activated. That extra action should contain an AppleScript actor with this code - which will make your Behaviour remain active until you explicitely choose another Behaviour:

tell application "Remote Buddy" to behaviourcore accessor "setSticky" with stickyValue

Once that action is created, you can reuse it in all your Behaviours.

 
Great... thanks for the tip. What application (if any) should I associate the constructed DVD behavior with? I think I remember needing to associate it with RB in order to get it to work when I was testing. Maybe I should create an applescript app that runs while i'm controlling the DVD player... any thoughts?

 
You don't necessarily need to associate a Behaviour with an application. However, if you don't, be sure that the option "this behaviour requires this application" at Behviour Factory > Specification and Metadata is not ticked. Your "application-less" Behaviour will not be loaded otherwise.

Hmmmmmm.... any chance that an API like that could be in a future release?

 
I'm sorry, but I generally can't comment on future releases and development.

Best regards, 
Felix Schwarz