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

23.02.2011 08:57:16
AppleScript: RB doesn't run "open for access" or "read" commands
View

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

I've been struggling with a script exhibiting strange behaviour for a week or two now. It would run fine in AppleScript Editor but only sometimes through Remote Buddy. I finally had time today to chase it down and it turns out that Remote Buddy seems to just stop execution when it meets a "read" or "open for access" command. My workaround has been to save the script as an application and use Remote Buddy to activate it by passing it off to the shell ("do shell script open my/app"). This is, of course, much slower than having Remote Buddy perform the execution directly.

Am I the only one seeing this behaviour and is there any way to get around it?

-Dave 

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

Hardware - Apple® Remote
User

23.02.2011 15:04:01
Re: AppleScript: RB doesn't run "open for access" or "read" commands
View

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

Thanks for asking.

First thought: 
When you run a script inside AppleScript Editor, it will transparently access any commands AppleScript Editor implements. When you run it inside Remote Buddy's context, this may then lead to different results.

What happens, if you enter your script into the Behaviour Construction Kit (or in a Custom Action) and run it there? What's the output in the text field below the source code field?

Best regards, 
Felix Schwarz 

User

23.02.2011 16:06:42
Re: AppleScript: RB doesn't run "open for access" or "read" commands
View

This posting is older than 6 months and can contain outdated information.
The feedback is simply "Execution succeeded."

This is part of the reason it took me a while to figure it out; until I had the time to really trace it through I'd see that it didn't give any errors and assume that it was working. Once I got on the right track I made a custom action with nothing but

set temp to read (the/path/to/theFile as alias) 
display dialog "foo"

and my dialog was never shown, but Remote Buddy still said "execution succeeded". Not that I'm using a wide variety of commands—or even extremely complex structure—but, for what it's worth, this is the only script that hasn't executed as expected.

-Dave 

User

02.06.2011 04:05:59
Re: AppleScript: RB doesn't run "open for access" or "read" commands
View

This posting is older than 6 months and can contain outdated information.
I'm have run into this same issue.

I have an Action defined with the following applescript.

tell application "Finder" 
do shell script "open foo.strm" 
end tell

Where "foo.strm" is configured in the finder to open in Boxee. If I run this script in Script Editor, a saved Script, or Script Application it opens the stream file correctly in Boxee (starting the application if it is not already running)

If I execute the same script as a Remote Buddy Action, it also opens the stream just fine. Now, if I put a remote buddy menu in the mix, it works just fine direct from AppleScript, but fails silently executed through a Remote Buddy command.

Here's the code I'm executing.

tell application "Finder" 
(* I'm actually generating this list of channels from a directory of .strm files *) 
set _channels to {"02.1 FOX HD", "02.1 FOX HD", "04.2 KRON HD", "04.2 KRON HD"} 
end tell

tell application "Remote Buddy" 
set the_menuitems to _channels as list 
showmenu with items the_menuitems as list menu name "Boxee TV Shows" with return value 
set _show to result 
set _filepath to "/Users/boxee/TV Shows/LiveTV/" & _show & ".strm" 
end tell

tell application "Finder" 
do shell script "open " & quoted form of _filepath 
end tell

User

10.06.2011 21:05:01
Re: AppleScript: RB doesn't run "open for access" or "read" commands
View

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

I googled around a bit on this topic and found this: 
http://macscripter.net/viewtopic.php?id=24745

-- quote -- 
The StandardAdditions OSAX -- part of the standard Mac OS installation -- includes a suite of six commands called File Read/Write. 
[..] 
open for access: open an access to a file for the other File Read/Write commands below." 
-- quote --

In a nutshell: 
"open for access" is not part of AppleScript itself, but instead is part of an OSAX scripting addition.

Currently, Remote Buddy doesn't seem to load OSAX scripting additions, so that these commands are not available for use from inside Remote Buddy. What you could do, of course, is to use AppleScript Editor to create executable code from your AppleScript and run that as part of your custom action.

Best regards, 
Felix Schwarz