Internal Toolbar Icons for PFA & POM Scripts

Features wanted...
Post Reply
jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Internal Toolbar Icons for PFA & POM Scripts

Post by jupe »

I am still discovering just how powerful this excellent application is, when I initially started customizing it I disabled Portable File Associations not seeing their true potential for my workflow, but now I have re-enabled them and found their untapped power I have a small request.

I have started associating scripts to the Portable Open With Menu and although I can give the scripts I associate icons of exe;ico I was wondering if it wouldn't be too much of a hassle to be able to use the internal toolbar icons in this location as well, just like is already possible in normal script captions.

e.g

Code: Select all

"Custom Script Caption|:home" ext>::run or whatever;

// Currently I would have to write it as below, unless I am mistaken.

"Custom Script Caption|HomeIconLocation.ico" ext>::run or whatever;
Also on a similar topic, If it's not too much of a hassle could you make it so as to be able to use a icon index in the Customize File Icons dialog like is already possible in normal scripts captions?

e.g

Code: Select all

*.ext>c:\Windows\System32\Executable.exe / 5
so that it would get the 5th icon in that file? Also dll file support in this location would be a nice bonus too because currently I have to manually extract the icons from dll's and then have them all in individually referenced ico files.


Thanks for your consideration.

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Internal Toolbar Icons for PFA & POM Scripts

Post by highend »

Not related to the topic per se but while you're at PFA:
viewtopic.php?f=7&t=13510
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Internal Toolbar Icons for PFA & POM Scripts

Post by admin »

For now I'll try to add the ":home" thing (aka Internal Toolbar Icons).

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Internal Toolbar Icons for PFA & POM Scripts

Post by jupe »

@admin: Ok cool thanks, no rush, I only asked because the functionality was already there in another area so I thought it might not be too time consuming, not that I have any real clue as to the amount of work involved, :eh: but it's appreciated.
highend wrote:Not related to the topic per se but while you're at PFA:
viewtopic.php?f=7&t=13510
.
@highend: Thanks for the tip, although I tried it and it looks good, what is supposed to happen when 2 apps are defined for 1 category? Looking at the code it looks like it launches both?
I think I got the syntax right, should the code below work? It seems to just launch whichever app is defined first and ignore the 2nd eg.

Code: Select all

vid=v:\mpc-be64.exe::v:\mediainfo.exe
Anyway I think for my use I will be able to stick to the internal functionality, I am really stunned with what's possible, here's an example of what I am doing for some file types, I might not have the syntax perfect :veryconfused: but it works great for me so far.

Code: Select all

"Edit or Load Script<tab>Shift|XYcopy.exe"xys>::selectitems "<curitem>";if (get("Shift") && "<curitem>"){load "<curitem>";} elseif ("<curitem>"){run """%APPDATA%\Notepad3.exe"" /pr ""<curitem>""";}
This gives me 2 quick access options for files where I have dual use cases (like image edit/load) and then I use the open with button drop down for a list of alternative apps & file type specific scripts that automatically changes depending on what extension I have selected, previously I had CTB's with items that were redundant when I am not on the right file type, but now I just have the one open with toolbar button that covers all file types, it's so awesome! :biggrin: And then for the top item in PFA I have "OpenWith"*>::button openwith;" which if I am going to be needing frequently for a brief period I can quickly enable so I don't have to move the cursor all the way to the toolbar, then when I'm finished heavy use cases disable it when not required, I'm still fine tuning my approach but having the Open With menu adapt its items to whatever file type is selected makes it so user friendly, at least for me and saves me a heap of custom buttons and scripted popup menus, and the generic file types like {:Image} are just icing on the cake. :P

I apologize if that was too much of a rant.!

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Internal Toolbar Icons for PFA & POM Scripts

Post by admin »

jupe wrote:@admin: Ok cool thanks, no rush, I only asked because the functionality was already there in another area so I thought it might not be too time consuming, not that I have any real clue as to the amount of work involved...
Well, I already added it to the last beta. :)

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Internal Toolbar Icons for PFA & POM Scripts

Post by klownboy »

Hi jupe, nice PFA. If you are still using the AHK function to detect right click, it will work fine in your PFAs as well. Edit: not in a PFA run directly via double click, only a POM. It's a little easier than holding down a shift key. You'll have to make sure you unset the perm variable (i.e., in my case $rmb) when done regardless of the if / else action taken.

Code: Select all

"Edit [L]<tab>Load Script [R]|:udc" xys>::if(isset($rmb) && "<pfaitem>"){load "<pfaitem>";} else {openwith "D:\Tools\AkelPad\AkelPad.exe", s;} unset $rmb;
I used SC openwith here since it works better when you want to open multiple files to edit though I certainly wouldn't want to load multiple scripts.
Last edited by klownboy on 30 Oct 2017 17:58, edited 1 time in total.

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Internal Toolbar Icons for PFA & POM Scripts

Post by klownboy »

Jupe, I think I may have confused your PFA example or tip, sorry. It had been too long since I worked with PFAs and in my case POMs. My example above can ONLY be used in a POM (i.e., if a user wants to have choices for a left and right click of the mouse on a POM menu item and is using the AHK function). It does not apply to a PFA which is opened directly when you have the "Open Items by First 'Open with...' Match:" option checked on the Openwith menu. Sorry for the confusion. Your example is exactly what someone wants to open items directly by double clicking or shift-double clicking. Thanks.

Post Reply