ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
321 stars 36 forks source link

Change {download_url} folder? #577

Closed maggotb closed 1 year ago

maggotb commented 1 year ago

Is there a way to download the files in desktop for exemple instead of the TEMP folder?

ssborbis commented 1 year ago

No, but I can add it

ssborbis commented 1 year ago

Ok, the question is, should this be a global setting or a per-engine param setting.

maggotb commented 1 year ago

Personally I don't mind but I guess per-engine would be better since it would give more options

ssborbis commented 1 year ago

If you want to change it yourself while I get something worked out, it's a pretty easy mod to ContextSearch.py

Instead of

tmpdir = tempfile.gettempdir()

change to

tmpdir = os.path.expanduser("~/Desktop")

or wherever your path is

ssborbis commented 1 year ago

latest version 1.46 has hidden option nativeAppDownloadFolder. This is a global setting to change your download folder. Future versions will have a way to set folder on a per-engine basis, and a "Ask Me" option that prompts the user with a folder browser so you can choose save location every time

maggotb commented 1 year ago

Thanks, I've been trying to figure it out but I can't get it to work. I updated the extension and the external app which is running fine.

I put

"nativeAppDownloadFolder": "D:\test"

then save

Am I missing something?

ssborbis commented 1 year ago

Python may require a forward slash or a double backslash. Try D:/test or maybe D:\\test. Also, make sure the directory exists. It won't create it.

ssborbis commented 1 year ago

FYI, I haven't tested on Windows so there may be something else up. I'll check that too.

maggotb commented 1 year ago

It doesn't work, even leaving nativeAppDownloadFolder blank doesn't work anyway. Yes I'm on Windows and I had created the folder of course

"C:\Program Files\XnViewMP\xnviewmp.exe" without "{download_url}" "works" it opens Xnview, if that's of any help

ssborbis commented 1 year ago

I'm testing on a virtualbox windows install with the following app launcher template

mspaint {download_url}

with ...

"nativeAppDownloadFolder": "C:/Users/ssborbis/Desktop",

... and native app v2.18

and it seems to be working Can you check with those settings on your rig and report the results?

ssborbis commented 1 year ago

I also tried "C:\Program Files\XnViewMP\xnviewmp.exe" "{download_url}" and had good results. Double-check you're on the latest versions.

maggotb commented 1 year ago

Yes I'm on the latest versions. It works now go figure