What I mean is that on several occasions I was able to successfully run a command in a terminal window opened in a certain folder, but when using a command (run not directly from terminal, but from a Thunar custom action) to do the same - that is: open a terminal in the same folder and run the same initial command - it would not work as expected.
For example, I have a folder that contains a pdf file. I want to save the pdf pages as images.
CASE 1: I open a terminal in that folder and run this command:
pdftoppm -png *.pdf prefix. The pdf pages are extracted as png files.
CASE 2: I try to do the same from Thunar custom actions. I create a custom action with the command
xfce4-terminal -e "pdftoppm -png *.pdf prefix", Appearance conditions; Directories, but that does nothing. To get more details, it is useful to keep that terminal window open after the command is run, but I do not know how to do that with the Xfce terminal. Using gnome-terminal I create a profile called new1 with the setting "When command exits: Hold the terminal open" then add to custom action this command:
gnome-terminal --window-with-profile=new1 -e "pdftoppm -png *.pdf prefix"
But this gives an error:
I/O Error: Couldn't open file '*.pdf': No such file or directory.
What is the difference between CASE 1 and CASE 2 which triggers the different results?
I have an answer to the question Thunar - Custom actions: save selected pdf as images. The command that works in Thunar custom actions is
pdftoppm %f -png %f.png.
But I am curious why a
command works in terminal but a different command that opens the terminal and runs that
command does not.