Page 1 of 1
Customize File Associations - long file names question
Posted: 04 Sep 2008 12:19
by petersboulton
Hi,
The 'Customize File Associations' feature and the ability to launch a selected data file in the chosen application is really useful!
I have one app, Corel Photo Paint 7 (a bit old, I know!) which seems to need the path to the data file in its command line enclosed by double inverted commas for long file names which contain spaces, as in:
C:\Corel\Draw70\programs\photopnt.exe
"G:\My Pictures\April 2008\IMG_4739.JPG"
(It's the bit
in red I'm talking about here!

)
I don't think XYplorer does this by default as Photo Paint interprets the command line argument as a series of file names (separated by the spaces in the file path to my .JPG).
Is there any way I can use the 'Customize File Associations' feature for apps like Photo Paint? (I'm not sure how many other apps might also have this problem).
Thanks!
Pete
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 13:26
by jacky
hmm... this should already be the case, XY sends the full file's path/name within quotes, and that whether or not there are spaces in the path/name actually. (I just tried to check, and that's how it works here.)
What you can try, to see how Photo Paint handles things, is try this from either Go to or Address Bar:
Code: Select all
First this one
::open '"C:\Corel\Draw70\programs\photopnt.exe" "G:\My Pictures\April 2008\IMG_4739.JPG"'
Then try this one
::open '"C:\Corel\Draw70\programs\photopnt.exe" G:\My Pictures\April 2008\IMG_4739.JPG'
The first one uses quotes on the command line, much lick what you get from PFA/POM, the second one does it without quotes.
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 18:06
by petersboulton
Thanks for your suggestions. I copied each command line directly off the page and pasted it into the Ctrl+G dialog in XYplorer and with both command lines absolutely nothing happened! Photopaint did not start and no error messages were posted.
I've been experimenting in the Windows Run command line and have some interesting (to me) findings:
"C:\Corel\Draw70\programs\photopnt.exe" G:\My Pictures\August 2008\DSCF0286.JPG
The above command line works. The following 2 don't and exhibit the same behaviour as I reported from XYplorer in my original post:
"C:\Corel\Draw70\programs\photopnt.exe" "G:\My Pictures\August 2008\DSCF0286.JPG"
C:\Corel\Draw70\programs\photopnt.exe "G:\My Pictures\August 2008\DSCF0286.JPG"
I would say the third one (no inverted commas around app path, inverted commas around image path) is 'correct' as far as the way I understand Windows expects to be able to launch processes.
Therefore I think there is something incorrect /non-standard in how PhotoPaint parses its command line arguments. The line that works should not really work as the path to the exe does not contain spaces (and therefore inverted commas should not be required) and the path to the image does have spaces (but no inverted spaces are required).
Er.. I suppose, although it would be lovely to have the feature working for PhotoPaint in XYplorer I really have to blame Corel and not Dennis!
Unless there is a workaround....
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 18:24
by serendipity
Just a tip. If it works with windows' run command then maybe you can try that script in XY's run command.
See here for details of XY's run command.
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 18:26
by jacky
petersboulton wrote:I copied each command line directly off the page and pasted it into the Ctrl+G dialog in XYplorer and with both command lines absolutely nothing happened! Photopaint did not start and no error messages were posted.
well, that's odd. You should have had either an error message from XY (if quick scripting wasn't enabled or the file.exe couldn't be found), or the app should have been started
Anyways, based on your result it seems that, for some odd reason, Photopaint doesn't like it when there are quotes, only when there are not, which means yes, it works opposite as everybody else!
petersboulton wrote:I would say the third one (no inverted commas around app path, inverted commas around image path) is 'correct' as far as the way I understand Windows expects to be able to launch processes.
Yes, actually both the second & third are correct. You can quote a path/name even if there are no spaces, but most of the time you have to when there are. This is however one rare case where you should not even when there are spaces! (Which means Photopaint cannot be sent more than one file names, obviously)
As for XY, I don't think there's a workaround right now, because even using script the variable <items> is always auto-quoted to avoid problems (well, it usually does avoid problems...

). The only thin I can think of right now would be to use the following PFA, but that means it will only work if you select one and only one item and it has focus -- so basically you if you click on one item, not more. (Selecting more items would result in XY trying to open the same item as many times as there are selected items, because it uses <curitem> as this one isn't "auto-quoted")
Code: Select all
jpg>::open '"C:\Corel\Draw70\programs\photopnt.exe" <curitem>';
That's for now, but Don might allow a way to use a non-quoted <items> in the future...
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 18:37
by petersboulton
Thanks Jacky!
I'm a newbie, so please forgive the dense question, but I pasted your text into the 'Customise File Associations' dialog box and made it association 1 in the list. It doesn't even pull in the PhotoPaint miniicon into the list like it does the others. And it doesn't even launch Photopaint.
I think I must be misunderstanding your directions! Sorry!
Pete
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 19:08
by jacky
petersboulton wrote:I'm a newbie, so please forgive the dense question, but I pasted your text into the 'Customise File Associations' dialog box and made it association 1 in the list. It doesn't even pull in the PhotoPaint miniicon into the list like it does the others. And it doesn't even launch Photopaint.
No worries, happy to help. About the icon, this actually is an XY Script so you will indeed get the script icon instead (white arrow on blue background), that's normal.
As for why it doesn't launch Photopaint, I don't know.

Much like the commands earlier you tried on Go to, you should get an error message if something was wrong. What version of XY are you using ?
What happens if you try only this on Go To:
Code: Select all
::open "C:\Corel\Draw70\programs\photopnt.exe";
Does it start?
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 19:22
by petersboulton
Hi Jacky,
Understand now, I think! Thanks for explaining.
In Ctrl+G, this works (launches Photopaint):
::open '"C:\Corel\Draw70\programs\photopnt.exe"';
With a jpg with a long filename selected in the list view, this does not do anything - no launch / no error box:
::open '"C:\Corel\Draw70\programs\photopnt.exe" <curitem>';
You suggested this:
jpg>::open '"C:\Corel\Draw70\programs\photopnt.exe" <curitem>';
Am I right in thinking this is for the 'Customize File Associations' dialog?
Thanks for taking the trouble to help me! Much appreciated.
At the end of the day it is a very small problem for me, which is not really caused by XYplorer anyway! Unfortunately there probably isn't a Photopaint 7 forum (as the software is so old most of the users are either retired or no longer with us!

)
Pete
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 19:33
by graham
have you tried (following on from serendipity post)?
::run "C:\Corel\Draw70\programs\photopnt.exe" G:\My Pictures\August 2008\DSCF0286.JPG
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 19:53
by petersboulton
Graham,
Eureka! Yes, that works, and so does this CFA:
jpg>::run "C:\Corel\Draw70\programs\photopnt.exe" <curitem>;
Fantastic - thanks!
Pete
Re: Customize File Associations - long file names question
Posted: 04 Sep 2008 19:55
by serendipity
Glad that it works. Happy XYploring!
