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

27.12.2011 11:45:33
Remote Buddy deactivating behaviour straight after I select it - but only the first time after a reboot
View

This posting is older than 6 months and can contain outdated information.
Got a strange issue here and I've not found a way around it.

I'm using the latest Remote Buddy (paid up version) with OS X Lion 10.7.2, on a Mac Mini.

I've configured a behaviour which:

1) on manual activation runs some AppleScript to open Safari and navigate it to a specific page (On Manual Activation in BCK default mappings) 
2) on deactivation runs some AppleScript to quit safari (On Deactivation in BCK default mappings)

It works fine, except in one specific case - straight after I have restarted my Mac. In this scenario, choosing the behaviour from the Remote Buddy menu and choosing to activate it causes it to run both the activate and then straightaway the deactivate actions. So Safari simply opens and closes immediately.

I've proved this is the case because if I remove the action from "On Deactivation" in BCK default mappings, Safari stays open.

However, subsequent attempts to use this behaviour work normally.

Is this a known issue and if so is there a workaround?

I've tried:

- quitting and reopening Remote Buddy before trying the behaviour for the first time after a restart 
- opening and closing Safari manually before trying the behaviour for the first time after a restart

Neither help.

Last edited: 27.12.2011 11:47:30 

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

Behaviours
Configuration
Developers
General
Hardware - Apple® Remote
User

05.01.2012 14:36:02
Re: Remote Buddy deactivating behaviour straight after I select it - but only the first time after a reboot
View

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

What probably happens is this:

1) Your Behaviour is activated. 
2) Your manual activation script is run, launching Safari 
3) Safari becomes the active application 
4) Remote Buddy automatically switches to the Safari Behaviour, which triggers the execution of your deactivation script

To selectively deactivate Remote Buddy's automatic switching to the Behaviour for the respectively active application, include this in your activation AppleScript prior to sending anything to Safari or any other application:

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

This way, your Behaviour will remain active until you manually switch away to another Behaviour. At which point Remote Buddy also returns to automatic switching of Behaviours.

Best regards, 
Felix Schwarz 

User

05.01.2012 14:44:48
Re: Remote Buddy deactivating behaviour straight after I select it - but only the first time after a reboot
View

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

I'm not sure if it can be the Safari behaviour because I have turned off all the behaviours except the one I created by unticking them all in the UI. Also, why would it only happen once, immediately after boot-up?

I solved it in the end by choosing the option in the UI for keeping activated until manually deactivated (maybe this is the same as the AppleScript you suggest), so I think your solution works but I'm a little dubious about the explanation... 

User

05.01.2012 15:28:01
Re: Remote Buddy deactivating behaviour straight after I select it - but only the first time after a reboot
View

This posting is older than 6 months and can contain outdated information.
Chances are you aren't targeting Safari with your Behaviour then (in terms of putting its bundle identifier in the respective field in the BCK).

If your Behaviour isn't associated to the active application in that way, it'll likely to be deactivated (and the "Default Behaviour" or "No Behaviour" be chosen instead) when an application switch occurs. 

User

05.01.2012 15:38:18
Re: Remote Buddy deactivating behaviour straight after I select it - but only the first time after a reboot
View

This posting is older than 6 months and can contain outdated information.
Ok, maybe that would explain it.

I have nothing specified in the application section of the behaviour (i.e. the bit where you can drag and drop an application into).

Instead I just execute some AppleScript (which launches and monitors Safari for my purposes) via a shell call to osascript in a 'Launch Safari' action that I created and assigned to the 'Activated' event for the behaviour.

I could probably bundle my AppleScript into an application using Automator and then drag it across and maybe then it would work, but that would mean that whenever I wanted to adjust my script I'd have to rebuild the app (or edit the contents of the bundle directly). Also, I pass command line arguments into the script, since I may want to use it in multiple contexts/behaviours and this is nice and easy using the method I have chosen.

Anyway, not a big deal really since I used the global switch to make behaviours 'stick' or I could use the method you suggest. Presumably if I set this sticky behaviour using AppleScript like you say then when the behaviour is activated then it stays until the behaviour is manually deactivated does it? I.e. I wouldn't need to explicitly turn it off with another AppleScript call or something? 

User

06.01.2012 09:25:01
Re: Remote Buddy deactivating behaviour straight after I select it - but only the first time after a reboot
View

This posting is older than 6 months and can contain outdated information.
 
Presumably if I set this sticky behaviour using AppleScript like you say then when the behaviour is activated then it stays until the behaviour is manually deactivated does it?

 
Yes, that's correct.

Best regards, 
Felix Schwarz