In gtkdialog GUIs, when I use a file called (for example) /root/File (blah).avi, then the brackets mess up gtkdialog, and the filenames are lost in the entry widgets of the GUI...
How do I solve this?
...I know I could do it myself, but I also know someone else double-fixed this in their own apps, but can't remember who..
While I am on the case, are there any other chars that mess up gtkdialog?
And.. Could we come up with a nice little func we could all use in our apps to get round this?
gtkdialog problem with filenames w brackets ( ) .. SOLVED
gtkdialog problem with filenames w brackets ( ) .. SOLVED
Last edited by sc0ttman on Mon 16 Sep 2013, 07:48, edited 1 time in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
Code: Select all
#! /bin/bash
ME=`readlink -f "$0"`
cd "${ME%/*}"
pwd
MUSINAME=`ls -1 *.avi | head -n1`
echo "$MUSINAME"
export MAIN_DIALOG="
<vbox>
<frame Simple>
<hbox>
<entry>
<variable>FILE</variable>
<default>\"$MUSINAME\"</default>
</entry>
<button>
<input file stock=\"gtk-open\"></input>
<variable>FILE_BROWSE</variable>
<action type=\"fileselect\">FILE</action>
</button>
</hbox>
</frame>
- Attachments
-
- filenameswithspechialcharsworksforme.jpg
- (115.66 KiB) Downloaded 1434 times
It's the brackets.. Using VLC-GTK will show what I mean...rcrsn51 wrote:@sc0ttman: Is your problem with the brackets or the embedded space in your example /root/File (blah).avi?
Like Karl, I don't see a problem with brackets.
Code: Select all
# vlc-gtk
# sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `echo /mnt/sde1/Audio/BBC/Alan Partridge/Knowing Me, Knowing You/Knowing Knowing Me, Knowing You (Special Documentary.)mp3'
Code: Select all
#VLC-GTK config file
#gui options
FILE="/mnt/sde1/Audio/BBC/Alan Partridge/Knowing Me, Knowing You/Knowing Knowing Me, Knowing You (Special Documentary).mp3"
Code: Select all
#VLC-GTK config file
#gui options
FILE="/mnt/sde1/Audio/BBC/Alan Partridge/Knowing Me, Knowing You/Knowing Knowing Me, Knowing You \(Special Documentary\).mp3"
Code: Select all
#VLC-GTK config file
#gui options
FILE="/mnt/sde1/Audio/BBC/Alan Partridge/Knowing Me, Knowing You/Knowing Knowing Me, Knowing You !£$%^\&*-=_+\({}~@:?\>\<\)Special Documentary.mp3"
Code: Select all
<entry>
<variable>FILE</variable>
<input>echo '${FILE}'</input>
<action>enable:FILE_BTN</action>
</entry>
Code: Select all
<entry>
<variable>FILE</variable>
<input>echo "'${FILE}'"</input>
<action>enable:FILE_BTN</action>
</entry>
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
...depends whether you got your gui string in double or single quotes..Karl Godt wrote:<default>"$MUSINAME"</default>
is the default coding style in Puppy gtkdialog , not something like
<default>'"$MUSINAME"'</default>
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]