'Open a File in with shell script in application without new instance? [closed]
I've got a picture converting tool for ubuntu which opens a window, where you can drag-and-drop a jpeg and automatically convert it in to a .wepb file.
This tool was written for the company that I work for and is automatically converting the pictures in to webp and adds a watermark logo on each picture so I have to use this tool. As far as I know, it's an xwindow tool using XDND for drag and drop. The person who wrote it is not reachable anymore.
Another option is to convert the pictures directly via the command line:
user@linux-desktop: ./jpeg2webp /Home/User/Dekstop/Pic1.jpeg
It work fine but when i use the bash/shell script it always opens a new instance of the Application.
Is there a way to tell the script to open the jpeg in the already opened instance maybe via the pid and prevent opening another instance? Or emulate a drag-and-drop on the app-window with the file path?
for example:
tell /Home/User/Dekstop/Pic1.jpeg to drag and drop on ./jpeg2webp application window
Solution 1:[1]
I was unable to find any information about the application you are using.
An alternative approach would be to use imagemagicks convert tool:
convert in.jpg out.webp
For convenience you could also use a small wrapper script to convert a file while keeping the original filename:
#!/bin/bash
name="${1%.*}" #get name from command line argument
convert "$1" "$name".webp
And run it as following:
./cwepb foo.jpg
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mashuptwice |
