More > JRiver Media Center 32 for Mac

Links: Opening External Program

<< < (5/7) > >>

MrBiff:
This isn't working correctly:


--- Code: ---<Link version="1.2">
<Item Name="Name">PRUNE</Item>
<Item Name="Action">0</Item>
<Item Name="Base URL"/>
<Item Name="Search URL"/>
<Item Name="Type">1</Item>
<Item Name="Program Path">//usr//bin//open</Item>
<Item Name="Program Parameters">//System//Applications//TextEdit.app  //tmp//test.txt</Item>
<Item Name="Filter"/>
</Link>
--- End code ---

It just opens a Terminal shell.

That's about all I'm able to get.

bob:

--- Quote from: MrBiff on January 30, 2024, 07:52:21 pm ---This isn't working correctly:


--- Code: ---<Link version="1.2">
<Item Name="Name">PRUNE</Item>
<Item Name="Action">0</Item>
<Item Name="Base URL"/>
<Item Name="Search URL"/>
<Item Name="Type">1</Item>
<Item Name="Program Path">//usr//bin//open</Item>
<Item Name="Program Parameters">//System//Applications//TextEdit.app  //tmp//test.txt</Item>
<Item Name="Filter"/>
</Link>
--- End code ---

It just opens a Terminal shell.

That's about all I'm able to get.

--- End quote ---
If you try it through the editor in 32.0.11 one arg should work. It does for me. I added a link to open the specified file with VLC.

The TextEdit.App is in the Program Path BTW. Not /bin/open

MrBiff:
What I'm ultimately trying to do is get a Terminal window open, and have it run a shell command + args.

Since this doesn't seem to work, I created an AppleScript, to do what I'm trying to accomplish.  The script works fine on the command line, and does the right thing. 

So then I try setting the program path (both directly and by using Browse) to /usr/bin/osascript.   But the script is not invoked.  Browse sets single forward slashes, btw.  I'm guessing Browse navigates into the app bundles contents to get the binary's path.  Obviously a command line executable does not have this.

Here's an AppleScript you can try, save to your home dir as "test.applescript"


--- Code: ---tell application "Terminal"
reopen
do script "echo arg1 arg2" in window 1
activate
end tell

--- End code ---

Test on the command line such as:


--- Code: ---osascript /Users/bob/test.applescript
--- End code ---

Maybe you can get this to work. 

bob:
That's not really what it's designed to do on Mac. The link is to an App. The system returns the App bundle then we call the App by it's bundle with the command line arg(s). It's up to the system to find the primary executable in the bundle and pass along the parameters to it setting capabilities based on the Apps plist.

Calling command line executables directly is a different matter. Perhaps that could be added.

MrBiff:

--- Quote from: bob on February 01, 2024, 09:51:22 am ---That's not really what it's designed to do on Mac. The link is to an App. The system returns the App bundle then we call the App by it's bundle with the command line arg(s). It's up to the system to find the primary executable in the bundle and pass along the parameters to it setting capabilities based on the Apps plist.

Calling command line executables directly is a different matter. Perhaps that could be added.

--- End quote ---

Being able to launch an App is good.

Being able to launch command line Mach-O would bring this in line with MC for Windows, where it works.  And this was my original intent / need.  It opens the door to many capabilities.  So this is what I'm asking for.  I'm hoping this can be added.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version