Could someone help me with a small scripting chore? I'd like to open the Firefox Profile Manager, using a new toolbar button.
- - - - - - - - - - - - - - - -
FOR THE RECORD....
I already have a working shortcut to the Profile Manager on my Windows desktop. From the shortcut's "Properties" window, here is a precise copy/paste of the target:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -profilemanager
- - - - - - - - - - - - - - - -
When I go to edit the new XYplorer toolbar button, I can't figure out what to type in the "On left click" field.
So far, I've tried:
open "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -profilemanager;
open "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -profilemanager";
open "C:\Program Files (x86)\Mozilla Firefox\firefox.exe -profilemanager";
No matter where I position those quote marks, clicking the new button spits up error messages. Can anyone see where I'm missing the boat? Kind thanks for the help.
Brooks
Win 7 Pro, x64
"Open" command for toolbar button - trouble scripting
-
BrooksNYC
- Posts: 26
- Joined: 03 Feb 2013 17:31
"Open" command for toolbar button - trouble scripting
XYplorer 27.20.0100 (32-bit)
Windows 10 Pro x64 (v 22H2)
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: "Open" command for toolbar button - trouble scripting
You need to quote the entire parameter you give to the open scripting command.
Plus since you're passing arguments to the Firefox executable you need to quote the executable (and its path) within the quoted parameter.
Thus you need either:Which uses single quotes to quote the parameter and double quotes to quote the executable.
Or:Which uses double quotes to quote the parameter and escaped double quotes to quote the executable. (In XY you escape quotes by doubling them up.)
In this case there is not much difference between the two but if you were to use variables within the parameter then you'd want to use the second to ensure they get resolved. The first treats them as literal strings and does not interpolate them.
Plus since you're passing arguments to the Firefox executable you need to quote the executable (and its path) within the quoted parameter.
Thus you need either:
Code: Select all
open '"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -profilemanager';Or:
Code: Select all
open """C:\Program Files (x86)\Mozilla Firefox\firefox.exe"" -profilemanager";In this case there is not much difference between the two but if you were to use variables within the parameter then you'd want to use the second to ensure they get resolved. The first treats them as literal strings and does not interpolate them.
-
BrooksNYC
- Posts: 26
- Joined: 03 Feb 2013 17:31
Re: "Open" command for toolbar button - trouble scripting
Thank you so much! I've been an XYplorer user since version 12.0, and this is the first time I've tried scripting. Old and feeble-minded as I am, I actually understand what you did!
NOTE: I've made a correction to my original post. Anyone CLAMORING for this shortcut
will want to know that there's a space between "Files" and "(86)", so that the code reads:
OR...
Again, I'm very grateful for your help, and thanks.
Brooks
NOTE: I've made a correction to my original post. Anyone CLAMORING for this shortcut
will want to know that there's a space between "Files" and "(86)", so that the code reads:Code: Select all
open '"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -profilemanager';Code: Select all
open """C:\Program Files (x86)\Mozilla Firefox\firefox.exe"" -profilemanager";Brooks
XYplorer 27.20.0100 (32-bit)
Windows 10 Pro x64 (v 22H2)
XYplorer Beta Club