moudey / Shell

Powerful context menu manager for Windows File Explorer
https://nilesoft.org
MIT License
3.62k stars 121 forks source link

Open multiple files into photoshop? #311

Closed clasteroid closed 1 year ago

clasteroid commented 1 year ago

I'm trying to build a context command to open multiple items into photoshop but can't get it working. I have this command added which will open a single .psd, .jpg or .RW2 file in photoshop:

shell { dynamic { item(title='Open with Photoshop' type='file' find='.psd|.jpg|.RW2' image cmd='Photoshop.exe' args='"@sel.path"') } }

I tried adding in the following to open more than one file but couldn't get it working.

where='sel.count > 1' title='Open (@sel.count) with PS'

shell { dynamic { item(where='sel.count > 1' title='Open (@sel.count) with PS' type='file' find='.psd|.jpg|.RW2' image cmd='Photoshop.exe' args='"@sel.path"') } }

Any help or hints are appreciated! Thanks!

RubicBG commented 1 year ago

add: mode='multiple' and write back if it works

clasteroid commented 1 year ago

Thanks RubicBG, that along with a couple other changes will allow the command to show in context menu and open photoshop when a group of the selected file types but only one of the files will open:

shell { dynamic { item(mode='multiple' vis=@(sel.count > 1) title='Open (@sel.count) with PS' type='file' find='.psd|.jpg|.RW2' image cmd='Photoshop.exe' args='"@sel.path"') } }

Do I need to add something to cmd or to args to allow multiple files to open at once? Thanks!

RubicBG commented 1 year ago

I can give some ideas to try, but I can't be sure how they will work:

  1. cmd='Photoshop.exe' if it is not recognized, you must write the full path
  2. if Photoshop can accept an array of paths, that's enough, if it can't - try with Invoke=1 https://nilesoft.org/docs/syntax/properties#_command-properties

here are some more tips:

  1. when you use find='.psd|.jpg|.RW2' there is no need for vis=@(sel.count > 1). if selected files are 0 - it does not find any of the desired extensions.

  2. use args=sel.path(true) or args=sel.path.quote instead of args='"@sel.path"'. Looks better :)

clasteroid commented 1 year ago

Awesome, thanks so much for the assistance RubicBG, with your help I have the following command opening multiple files into photoshop:

shell { dynamic { item(mode='multiple' title='Open (@sel.count) with PS' type='file' find='.psd|.jpg|.RW2' image cmd='Photoshop.exe' Invoke=1 args=sel.path(true)) } }

My next question is that the command seems to open files in sequence instead of all at once. If raw files (.RW2) are opened all at once then photoshop will give you them all in the same dialog. Currently it bring them up in separate dialogs.

Any suggestions?

Thanks again!

RubicBG commented 1 year ago

depending on whether photoshop can process an array of selected files, there are two cases:

you have to try what works