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

01.09.2011 22:07:48
Ruby script doesn't work like the others
View

This posting is older than 6 months and can contain outdated information.
Hi there, 
I am encountering some difficulties. From "Run actor" button in Behaviour Construction Kit. This applescript code:

do shell script "~/Library/bin/lgremote press status_bar"

works for command line programs written in C or C++. Which were compiled. However for this "lgremote" Ruby script - no success. It does not appear to work I am not certain if there script is executed or it returns with an error. Is there a way to find out (eg logging)? The same applescript will work from the terminal.

osascript -e "do shell script \"~/Library/bin/lgremote press status_bar\""

Works fine. Is there a way to see what is happening?

The "lgremote" ruby script can be found at:

https://github.com/dreamcat4/lgremote

Many thanks. 

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

Behaviours
Developers
Hardware
Hardware - Apple® Remote
User

02.09.2011 09:56:02
Re: Ruby script doesn't work like the others
View

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

While I have no expertise regarding "do shell script", here are a few quick thoughts:

1) I'm not sure "do shell script" is part of the core set of AppleScript commands. If it's part of a scripting addition, it may not be available from within Remote Buddy.

2) Usually, scripts are only executed if they have the executable (x) bit set for them. If you downloaded the script from a website, this may not automatically be the case. You can add it in Terminal.app with

chmod ug+x /path/to/file

3) In a shell, you can usually redirect any output from the script (this should include error messages) by appending a >/path/to/logfile (file will be overwritten on each run) or >>/path/to/logfile (file will be appended with each run). F.ex.

ls -al / >~/Desktop/out.txt

will put the output of "ls -al /" into out.txt on your desktop. This tech note by Apple suggests there are other ways to output the result, too:

http://developer.apple.com/library/mac/#technotes/tn2065/_index.html

Best regards, 
Felix Schwarz 

User

02.09.2011 11:56:02
Re: Re: Ruby script doesn't work like the others
View

This posting is older than 6 months and can contain outdated information.
On Fri, Sep 2, 2011 at 8:56 AM, Felix 
wrote:

3) In a shell, you can usually redirect any output from the script (this should include error messages) by appending a >/path/to/logfile (file will be overwritten on each run) or >>/path/to/logfile (file will be appended with each run). F.ex.

ls -al / >~/Desktop/out.txt

 
Thank you. This helped to solve the problem. There was no login shell 
(bash -i) to set up the ruby environment.

will put the output of "ls -al /" into out.txt on your desktop. This tech note by Apple suggests there are other ways to output the result, too:

http://developer.apple.com/library/mac/#technotes/tn2065/_index.html

Best regards, 
Felix Schwarz

 
[standard mail footer removed]