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

10.06.2010 13:45:45
Execute shell script named x.command in file browser no longer working
View

This posting is older than 6 months and can contain outdated information.
I have until upgrading Remote Buddy and OS X to 10.5 been executing shell scripts from the file browser.

A shell script named x.command is executable in the finder still but I find I am not able to get Remote Buddy to execute my scripts.

Any help on this much appreciated.

I have checked for new options without any luck.

Cheers,

Sefton

Last edited: 10.06.2010 13:55:20 

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

Hardware - Apple® Remote
User

14.06.2010 02:39:36
Re: Execute shell script named x.command
View

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

You can execute your shell script by creating a custom action containing an AppleScript to execute your shell script.

There's a nice article on how to execute shell commands over at developer.apple.com: 
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html

Best regards, 
Felix Schwarz 

User

16.07.2010 09:48:48
Re: Execute shell script named x.command
View

This posting is older than 6 months and can contain outdated information.
Thank you for responding but unfortunately this does not help me.

Is this function (the ability to execute .command files) no longer a part of remote buddy?

If not can you tell me which version I have to downgrade to so that this great feature is again available to me.

I have a series of scripts that where very convenient that I cannot use without this feature for example I have a script that will call "open" sequentially on each other file in the folder so that I do not have to remember where in a series of episodes I am up to I just use the file browser and activate the script.

e.g.

#!/usr/bin/env bash

go=1 
(( next = go + 1 )) 
sed -i.rm_me -e "s/go=$go/go=$next/" "$0" 
(sleep 1;rm -f "$0.rm_me") & 
path=$(dirname "$0") 
(( open_number = next + 1 )) 
open=$(ls "$path" |head -n${open_number}|tail -n1) 
echo "$path/$open" 
echo "$(date) $path/$open" >> "$0" 
open "$path/$open" 
exit

this opens the next file in the same folder as the script and logs what was opened.

I use this script from a network mount from any machine.

I am not sure that it will be possible to do this with an apple script.

This script was very useful and I miss very much being able to use it from remote buddy. I have been using vnc to activate the script via the finder and using remote buddy a lot less because of the lack of this very nice feature.

Cheers

Sefton 

User

16.07.2010 10:47:11
Re: Re: Execute shell script named x.command
View

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

Remote Buddy never had direct support for shell scripting-

The only way to execute .command files directly via Remote Buddy is either

a) via Remote Buddy's file browser 
b) when you added such a file to the menu via drag & drop from the Finder

In both cases, Remote Buddy will ask Launch Services for the applications capable of handling this file type and

a) either open it directly with it (if only one application is capable of handling it) 
b) offer you the choice to choose an application to open the file, preselecting the default one for you

In the case of .command files, the default application is Terminal.app. Please check in Finder whether Terminal.app is still the default application for .command files and adjust it as necessary. You can do this by right clicking on a .command file in Finder and then select "Get Info" from the popup. There you'll find both the default application info as well as the ability to change it.

To execute a script from within a custom action in Remote Buddy, you can use AppleScript. Apple has a nice TechNote on this: 
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html

Best regards, 
Felix Schwarz 

User

17.07.2010 01:46:10
Re: Execute shell script named x.command
View

This posting is older than 6 months and can contain outdated information.
Cheers for the help. My scripts are executable from the command line and function correctly from the finder ( I am using vnc as a workaround) but are no longer launched from the Remote buddy file browser.

I have tried changing the default application and adding additional applications to the open with dialog.

It seems that some file extensions are no longer working with remote buddy file browser which I assume could be an issue with my launch services.

If named .txt or .avi the file browser will navigate to the equivalent of an "open with" in the remote buddy file browser but if the file has a .command or .sh extension remote buddy does not allow me to open or execute the file and seems to refuse to hand of the file to anything.

I will reset launch services and see if that helps.

Cheers

Sefton 

User

17.07.2010 02:16:26
Re: Execute shell script named x.command
View

This posting is older than 6 months and can contain outdated information.
Reseting launch services did not fix it.

If I change the file extension to .txt and the change .txt files to open in the terminal (via get info) I can get it to work in the remote buddy file browser. It seems like the Remote buddy file browser will only allow some file extensions or file types to be opened and .command is no longer one of them.

I am not sure this is an issue with launch services as .command files still open in their chosen application via the finder.

Is there possibly a whitelist of file extensions for the remote buddy file browser that no longer contains .command.

Could I ask if anyone else can reproduce this.

Thanks

Sefton

User

17.07.2010 05:36:50
Re: Execute shell script named x.command
View

This posting is older than 6 months and can contain outdated information.
After reading the Launch Services Reference at:

http://developer.apple.com/mac/library/documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html

... Finder itself uses Launch Services to open applications, documents, and URLs ...

 
Reading this makes it seem to me that if the Finder is able to utilise Launch Services to pass the .command files to the terminal that there is an issue with the way Remote buddy is interacting with the Launch Services API.

Also the open command which utilises Launch Services is correctly launching .command files.

Are you using LSGetApplicationForItem to generate the list of applications displayed in the Remote buddy file manager?

I will endeavour to try and determine if this is indeed an issue with the Launch Services API, my install of OS X or if in fact there a bug in Remote Buddy.

Can you please confirm that Remote Buddy is still able to launch files with the .command extension and so I know that this issue is confined to just my case.

Could you also tell me the version of OS X you are using where this works so that I can try and reproduce your success.

Thanks for your time,

Sefton

User

20.07.2010 16:38:41
Re: Re: Execute shell script named x.command
View

This posting is older than 6 months and can contain outdated information.
I've looked into the code now and Remote Buddy uses the more modern LSGetApplicationForURL API.

The decisive part here, however, isn't the flavor of API call used, but the roles mask. Right now, Remote Buddy is only asking for viewers and editors, but not shells.

I'll evaluate the security implications of including shells here as well and may or may not add it to one of the next versions.

Until then, you should be able to execute .command files simply by installing iTerm (at least the old version I've installed identifies itself as an editor or viewer to the system, not as a shell - and is therefore listed).

Best regards, 
Felix Schwarz 

User

21.07.2010 11:40:08
Re: Execute shell script named x.command
View

This posting is older than 6 months and can contain outdated information.
Thank you so very much Felix for finding that workaround.

iTerm was not working in the same way as terminal but after using iTerm once I was then able to again use the terminal.

Very very strange but after assigning .command files to iTerm then back to terminal I was again able to execute .command files in the Remote Buddy file browser.

I am again loving Remote Buddy as I have the full power of a shell at the end of my tiny apple remote.

Cheers and many thanks

Sefton