Closed runningcheese closed 2 years ago
Anyway, i have made a big promotion in my soical network, to introduce your great extension to my following fans!
Hmm.. to be honest, I've never tested on mac. I assumed, based on the reference material from MDN, that it would work similar to linux. I can see on your screenshots, the messenger app is connected ( v2.14 ) . You might need to be setting the working directory to the folder those app binaries are located in. I don't have a mac OS handy to test. I'll see about setting up a virtual machine.
@ssborbis
could you please take a screenshot from your linux, to show how you make the settings?
and i have try "working directory", it's still not happening, but it works on Windows.
anyway,
i used to use this addon: https://addons.mozilla.org/zh-CN/firefox/addon/open-with, and it works on windows and mac.
Thanks for your reply!
I am in the process of installing a MacOS virtual machine. I will update you when I have the app launcher feature up and working.
I am in the process of installing a MacOS virtual machine. I will update you when I have the app launcher feature up and working.
thanks for your great work!
It looks like /Applications/Firefox.app
is actually a directory. You need to point to the binary within.
/Applications/Firefox.app/Contents/MacOS/firefox-bin "{searchTerms}"
I assume the same is true of other .app
listings found under /Applications/
@ssborbis
Thanks for your Testing.
It works fine now!!
But when i lanugh "Downie 4" which is a video download tool, it will start the application, but will not start download the url.
That makes me confused.
And one more thing!
is it possible to lanugh "Photoshop" and open the image in Photoshop? (both windows and mac)
Thanks in advance.
is it possible to lanugh "Photoshop" and open the image in Photoshop
Probably. I assume photoshop can open an url directly, but if not, use a script to download the url & open in photoshop instead.
This is how I open an url in GIMP
"C:\\Program Files\\GIMP 2\\bin\\gimp-2.10.exe" -n -a "{searchTerms}"
I'm sure PS has a similar option. I don't have PS, so you'll need to look through the command line options.
when i lanugh "Downie 4" which is a video download tool, it will start the application, but will not start download the url
It may not accept URLs from the command line.
Here we go. This is a better way to launch apps on Mac
open -a 'Downie 4' "{searchTerms}"
open -a 'Firefox' "{searchTerms}"
etc
Here we go. This is a better way to launch apps on Mac
open -a 'Downie 4' "{searchTerms}"
open -a 'Firefox' "{searchTerms}"
etc
Love you!
Everything works fine now!!!
But Photoshop still can't open an image directly, either windows or mac.
But it's fine for me.
Maybe because of the photoshop limitation.
if photoshop doesn't have a built-in way, you can use the curl
trick I posted in #500
for windows, it would probably be something like this
curl "{searchTerms}" -o tmp & "c:\\path\to\photoshop.exe" tmp
If curl isn't included on macOS, it's easy enough to get. It should be similar syntax
I just try curl command, but still can not open image directly.
It's fine for me, if can not make it happen.
if photoshop doesn't have a built-in way, you can use the
curl
trick I posted in #500
"D:\\path\to\photoshop.exe" -n -a "{searchTerms}"
This can open PS, but no pictures.
curl "{searchTerms}" -o tmp & "D:\\path\to\photoshop.exe" tmp
This can also open PS, but PS doesn't support tmp format.
Cannot complete the clear request because it is not the type of document referred to.
But it can be used on Krita.
curl "{searchTerms}" -o tmp & "D:\\Program Files\\Krita (x64)\\bin\\krita.exe" tmp
Sorry, I don't have photoshop for testing. ( Is there a free version? ). There's always a way.
Sorry, I don't have photoshop for testing. ( Is there a free version? ). There's always a way.
Yeah, it has a 7-day free trial.
The following script allows for downloading a file via cURL to the macOS temporary folder and opening the file, by name, with the application of choice.
download.sh
#!/bin/sh
cd $TMPDIR
FILENAME=`curl -OJs -w %{filename_effective} $2`
open -a $1 $TMPDIR/$FILENAME
Make sure to chmod +x the file, and place it somewhere you know. Then your application launcher command will look like this:
/Users/virtualuser/download.sh "Firefox" "{searchTerms}"
replace "Firefox" with whatever app can be called by open -a
. If calling binaries more directly, you'll need to modify the script.
@ssborbis
still not working! but it's fine, it's great enough for me.
I refuse to believe Photoshop can't open files from a shell script. If I can get PS installed, I'll figure out something.
I refuse to believe Photoshop can't open files from a shell script. If I can get PS installed, I'll figure out something.
Maybe you can download it from the Pirate Bay. I don't know if it's allowed in your region.
@ssborbis
One more question please!
How to lanugh "yt-dlp" on macOS? it doesn't work with open -a command.
@runningcheese
Have you tried calling yt-dlp directly, without the open -a "Terminal"
?
@ssborbis
Unfortunatly, Not Working!
mac appears to be a bit of a pain to play nice with the terminal. This is the command I've had the best luck with. Edit to your specs
osascript -e 'tell app "Terminal" to do script "/Users/virtualuser/Downloads/yt-dlp -P /Users/virtualuser/Desktop --no-playlist \"{searchTerms}\""'
I'm having some ssl cert issues, so that command doesn't actually download anything, but it looks like the command is working.
The terminal opens in the background, and doesn't close when complete. I just don't know enough about mac to fix that. I'm sure there's a way. You'll have to do some googling.
osascript -e 'tell app "Terminal" to do script "/Users/virtualuser/Downloads/yt-dlp -P /Users/virtualuser/Desktop --no-playlist \"{searchTerms}\""'
It works fine!! love you!
I had a mistake in the download.sh
script. Put a $ when it should have been a %
Here's a corrected script that should work on mac and linux
#!/bin/sh
TMP="/tmp"
if [ "$OSTYPE" = 'darwin'* ]; then TMP=$TMPDIR; fi
cd $TMP
FILENAME=`curl -OJs -w "%{filename_effective}" $2`
$1 $TMP/$FILENAME
App launcher command would be something like:
/path/to/download.sh "open -a Photoshop" "{searchTerms}"
FYI, in future versions of this addon, you'll simply check a box on the app launcher edit modal to have the python native app download the file to be opened. No script needed. I'm testing now on linux. Looks good so far.
@ssborbis Thanks for your great work, looking forward to...
I posted a beta you can try out.
Replace the param {searchTerms}
with {download_url}
in app launcher templates to direct the native app to download the file found at the URL you've presumably searched for through CS.
For example, to download a file by URL and open in GIMP in linux, I'm using this template
gimp -a "{download_url}"
You'll need the lastest version of the native app ( ContextSearch.py v2.16 ) https://github.com/ssborbis/ContextSearch-Native-App/raw/master/ContextSearch.py
@ssborbis Seems not happening!
and when i replace the 2.16 version of ContextSearch.py, it will show "message app is not connected".
i have retyped "python3 install.py".
and please try photoshop on mac or linux:https://linuxhint.com/install_adobe_photoshop_linux
and one more question, how to lanuch yt-dl on linux?
this is what i did.
I just tried the install.py script. It seems to be working for me. What OS is it failing on? Any error messages?
and one more question, how to lanuch yt-dl on linux?
I'm not familiar with deepin-terminal. The --
command is probably gnome-terminal specific. Check the help output and see what it says about launching a new terminal.
I just tried the install.py script. It seems to be working for me. What OS is it failing on? Any error messages?
You might also double-check that ContextSearch.py has permission to execute. ( chmod +x ).
Thanks for the new parameter. I tried 1.40b5.xpi\2.17 with {download_url} and it seems to works fine with standard image\document links (on Windows: XnView, MSPaint, PS, SumatraPDF). It's just gets better and better.
Replace the param
{searchTerms}
with{download_url}
in app launcher templates to direct the native app to download the file found at the URL you've presumably searched for through CS.For example, to download a file by URL and open in GIMP in linux, I'm using this template
gimp -a "{download_url}"
Thanks, I haven't tried Ps since the update, now I can open it. 😍
"Photoshop.exe" - a "{download_url}"
@ssborbis For me, some image downloads require a proxy, so how do I get Messenger app to use a proxy to download?
For me, some image downloads require a proxy, so how do I get Messenger app to use a proxy to download?
Uh, I'm not sure. How does the proxy manage requests? If it's by tacking an url to the end of another url ( http://myproxyexample.com/url=http%3A%2F%2Furl.to%2Fimage.jpg ) or something similar, you can use the Modify Terms Regex field. If it's something more complicated, you might need to modify ContextSearch.py
thanks for your extension, you did a good job.
but when i try to lanugh a browser, it works well in windows, but doesn't work in mac?
did i miss out something?