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

19.11.2007 20:29:50
Scripting Bridge and Remote Buddy
View

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

I was trying to take advantage of the Script Remote functionality from within my objective-C application using the apple Scripting Bridge technology (https://developer.apple.com/leopard/devcenter/docs/documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/index.html). 
However, when I run the command to generate the headerfile for Remote Buddy I get an almost empty header file:

sdef "Remote Buddy.app" | sdp -fh --basename RemoteBuddy

results in: 
/* 
* RemoteBuddy.h 
*/

#import <AppKit/AppKit.h> 
#import <ScriptingBridge/ScriptingBridge.h>

I've tried the same on other apple and non-apple scriptable applications, and there I get a complete header file. 
Any idea why the generated header file for Remote Buddy is empty? Something not right with the Remote Buddy sdef file?

regards,

Kjeld. 

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

Hardware - Apple® Remote
User

27.11.2007 00:42:01
Re: Scripting Bridge and Remote Buddy
View

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

thanks for reporting this.

I, too, couldn't find the source of the problem, so I asked those who 
should know:

http://lists.apple.com/archives/Applescript-implementors/2007/Nov/msg00102..html

The problem seems to be that sdp requires an sdef file to contain an 
application class:

So, if you replace

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd 
"> 
<dictionary title="Remote Buddy"> 
<suite name="Remote Buddy Suite" code="RmBS"> 
<command name="behaviourcore" code="behacore" description="Modify 
Behaviour handling."> 
<cocoa class="RBBehaviourScriptCommand"/> 
...

by

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd 
"> 
<dictionary title="Remote Buddy"> 
<suite name="Remote Buddy Suite" code="RmBS"> 
<class name="application" code="capp" description="The application 
program"> 
</class> 
<command name="behaviourcore" code="behacore" description="Modify 
Behaviour handling."> 
<cocoa class="RBBehaviourScriptCommand"/> 
...

you can generate the header:

-- cut -- 
/* 
* RemoteBuddy.h 
*/

#import <AppKit/AppKit.h> 
#import <ScriptingBridge/ScriptingBridge.h>

@class RemoteBuddyApplication;

 
/* 
* Remote Buddy Suite 
*/

// The application program 
@interface RemoteBuddyApplication : SBApplication

- (id) behaviourcoreAccessor:(NSString *)accessor identifier:(NSString 
*)identifier stickyValue:(BOOL)stickyValue useActivationEventCode: 
(NSString *)useActivationEventCode; // Modify Behaviour handling. 
- (NSArray *) behaviourlistAllGlobalActionsForIdentifier:(NSString 
*)allGlobalActionsForIdentifier; // Receive a list of the identifiers 
of all available Behaviours or the available actions of one Behaviour. 
- (BOOL) behaviouractionEvent:(NSString *)event buttonCode: 
(NSInteger)buttonCode actionIdentifier:(NSString 
*)actionIdentifier; // Invoke an action by its identifier 
- (NSString *) localizeString:(NSString *)string inBundle:(NSString 
*)inBundle; // Localize a string using a Localizable.strings look up 
table inside a bundle. 
- (void) osdmessageDisplayText:(NSString *)displayText forDuration: 
(double)forDuration; // Display a textual OSD message. 
- (id) readValueForKey:(NSString *)valueForKey inDomain:(NSString 
*)inDomain withDefaultValue:(id)withDefaultValue; // Read a 
previously stored value. 
- (void) scriptremoteButton:(NSString *)button event:(NSString 
*)event; // The Script Remote is a virtual remote control input 
device in Remote Buddy. It enables you to f.ex. send events from 
driver software to Remote Buddy and use Remote Buddy as if it would 
directly support the hardware supported by that driver software. 
- (id) showmenuWithItems:(id)withItems returnValue:(BOOL)returnValue 
menuName:(NSString *)menuName; // Open a menu for the user to choose 
from. 
- (void) storeValue:(id)value forKey:(NSString *)forKey inDomain: 
(NSString *)inDomain; // Store a value temporarily or permanently for 
later reuse. All stored values are global to all scripts run, so 
several scripts can share values. 
- (BOOL) visualizeEffect:(NSString *)effect forDuration: 
(double)forDuration withColor:(NSString *)withColor; // Trigger 
visual effects like fade in / out. 
- (void) virtualkeyboardEvent:(NSString *)event; // Perform an 
virtual keyboard action. 
- (void) GetURL:(NSString *)x; // Open an URL

@end 
-- cut --

The RemoteBuddy.sdef will contain the empty application class starting 
with the next version.

Best regards, 
Felix

[standard mail footer removed]

 
User

27.11.2007 22:47:56
Re: Scripting Bridge and Remote Buddy
View

This posting is older than 6 months and can contain outdated information.
Thanx Felix, that did it.

I now wrote some code which should work (with remoteBuddy being my SBApplication object):

[remoteBuddy scriptremoteButton:@"menu" event:@"click"];

But all I'm getting is the following error when running:

[SBApplication scriptremoteButton:event:]: unrecognized selector sent to instance 0x10498d0

Anything I'm missing here?

Kjeld.