Using "Photos" in Windows 10 with XYplorer

What other productivity software are you working with...
klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

This past weekend I used "Photos" which comes with Windows 10 for the first time. I'm not talking about the older Photo Viewer. If you're doing some editing like cropping, flipping, tilting, filtering or brightness, it's actually quite user friendly. I like the cropping feature since it has built-in (or custom) aspect ratios you'd want and it's very easy to move the photo around within the aspect ratio frame to achieve what you're after. I think Msofty got something right with this app.

Unfortunately it is a universal app, if that's what they call it now. Because of that there seems to be no way you can call it out with a parameter like current file <curitem> to use it in a script. But, it is listed under the "Open with" listing in the context menu (Microsoft's not XY). I spend way too much time Googling that possibility and found out it's not possible. What I ended up doing was placing a shortcut command in my startup AHK file similar to this such that when I hit "Control key and `, the current image file is loaded in "Photos". You can start the app with ms-photos: or Microsoft.Windows.Photos_8wekyb3d8bbwe!App if that all you want to do, but it should be in startup apps.

Code: Select all

^`::
If ( HWND := WinExist("ahk_class ThunderRT6FormDC") )
{
	SendInput {AppsKey}{h}{Down 5}{Enter}
return
}
Does any one know if XYplorer's undocumented sendkeys is capable of sending an AppsKey or the simulated right click on a file name to bring up the context menu (I had no luck)?
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Using "Photos" in Windows 10 with XYplorer

Post by highend »

The menu key can be also invoked via shift + F10, so maybe something like this:

Code: Select all

sendkeys "+{F10}";
?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

Great highend. I figured there must be some key combo that did it. This worked better and faster than going through AHK since it's all in house. Thanks.

Code: Select all

  sendkeys "+{F10}{h}{Down 5}{Enter}";
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog »

I kind of liked Photos for quick and dirty as well - until I discovered ImageMagick. There's an extraordinarily rapid IMDisplay.exe that has a few common features like crop and rotate, but the command line things you can do with it are truly awesome - though they often do take some research, but only, like things on computers, as you set up what you want to do the first time.

You might want to look into it. I think integrating XY into powerful photo editing features can be done no better. I own a Photoshop, etc. subscription, but for simple things, this rocks. Common tasks are now done with Custom File Association lightweight scripts. Example: I can up or downsize a photo to whatever size I want, using very sophisticated techniques as good or better than what you'll get in Photoshop - from a single line. Message me if you're curious. Can Photos resize an image using best technology, including sharpen, from the command line almost instantly?

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

Hi DustyDog, I totally agree on ImageMagick. It is extremely powerful. I've written a few scripts that use it. A FolderMontage script here viewtopic.php?f=7&t=12843 and a PhotoCropper script also here viewtopic.php?f=7&t=8793 Though I think that very old version I posted was using Irfanview, but I have another that uses IM.

The main reason for my post on Photos was because I like the simplicity of cropping a hi-res photo to different standard "preset" aspect ratios (e.g., from a camera 4:3 or 3:2 to a 16:9 for a desktop wallpaper). It's great in these cases to be able to move the resultant aspect ratio frame around in the picture to get the crop placement just right. You can crop in IMDisplay, but it doesn't have the standard preset aspect ratios (e.g., 4x3 or 16x9) which really ease the cropping procedure (i.e., the cropping lines in Irfanview and Photos will be set to the aspect ratio selected and then you can simply move it around to establish where to crop).
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog »

I agree! So, how exactly are you managing to use it effectively with XY? The simpleton version? Photoshop is just a plain pain to load for minor tasks, as are some other lighter utilities I've found, and really, for similar reasons to what you state. Plus, I do kind of like zooming with my fingers on my screen :) For quick and dirty, it really does do a reasonable job. I've got a few other universal apps I wish I could use similarly - not great moments in programming, most, but good at what they do.

I did (at least at one point) understand how to get the code to start one (though I suppose I'd need to look it up again), and I have used the technique of loading a clipboard folder or file name on some apps that can take a paste quickly but not a command line file, but from what little I can make of what you're doing, it sounds like you're on to something?

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

Unfortunately "Photos", being one of the Windows universal apps, does not accept command line arguments. So you can't run the currently selected file the normal way. I mentioned this in the earlier posts. I ended up using sendkeys to essentially open the context menu and select/enter "Photos". This is based on you having Photos on your Windows "Open with..." context menu (not the Xyplorer "Open with..."). You may have to adjust the number after "down" depending on where "Photos" appears on the Open with...menu (my Photos entry is 5 down from the top).

Code: Select all

  if(<curext> LikeI "jpg") {sendkeys "+{F10}{h}{Down 5}{Enter}";}
I set up a User defined command for the "=" key to open the current file in Photos. It's kind of a primitive way to do it, but I did quite a bit of research and there didn't appear to be any other way (because it's a universal app). I hadn't tried until now to do this on a Customized File Associations but this works also.

Code: Select all

"Photos|:favs" jpg>sendkeys "+{F10}{h}{Down 5}{Enter}";
It actually seems to run/open a bit faster using the Customized File Association.

There are a few ways to open the "Photos" app but it will not accept a command line argument like the current file.

Code: Select all

::open "ms-photos:";
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog »

That was exceedingly clear. Thank you. I'll use the information.

Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog »

One thing I like to do with uncooperative programs is add something like.

copytext "<curpath>\"; (Or a variation to ad _ed or whatever.)

Right before whatever open commands I'm using. Makes it so you can just paste to save in the original location and type a new name for "Save a Copy" instead of being stuck with Pictures (or whatever) as a default and have to go hunting or remember to do it manually.

In a lightweight tagger that I use, I do the same thing to open the folder I'm interested in (it won't take command line arguments): I just have to hit ctrl-o then ctrl-v - just about as quick.

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

That's a good idea - getting the path in the clipboard just prior to opening a file in a program. You could also use command ID #101 which would copy the full path and filename of the selected file into the clipboard. Which is equivalent to using Ctrl - P. In the case of using "Photos" it does seem to be better than some programs in that it does save the modified copy of the image in the same folder as the original and not some previously used folder.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Starhowl
Posts: 11
Joined: 08 Jan 2013 11:41

The state of the matter in 2020

Post by Starhowl »

When opening a picture via the context menu that I'm getting from XYplorer, I still can't use the arrow keys to navigate through the whole folder, only when taking the same path in the context menu via File Explorer. So how can I open the Photos-App from inside XYplorer in a way that I will be able to browse through all the pictures in that same folder? :|

Has the general state regarding knowledge on how this can be done changed in 2020, now that version 2004 is around the corner?

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

Starhowl wrote: 18 Apr 2020 12:48 So how can I open the Photos-App from inside XYplorer in a way that I will be able to browse through all the pictures in that same folder?
I wasn't able to do what you're asking either. I see what you mean though, the arrow buttons are not available when opened via XYplorer verses File Explorer. I even tried changing my defaults image viewer from ImageEye to Photos with no difference.

However, if you do the following: (1) open Photos using a Customized File Association like "Photos" {:Image}>::run """explorer.exe"" shell:appsFolder\Microsoft.Windows.Photos_8wekyb3d8bbwe!App"; and (2) in the "Settings" option within Photos add your folder of pictures, (3) when you use the XYplorer "Open with..." menu on right click of an image or (Ctrl+Alt+Enter), Photos opens and then you can select an image from your image folder, it will have the arrows. It's a convoluted way, but that's all I can suggest...at least for now. Let us all know if you come up with a more direct way.

Honestly, I'd rather use XYplorer (thumbnails and MDBU) or ImageEye (extremely fast) for strictly viewing images and Gimp for minor editing like cropping etc.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Starhowl
Posts: 11
Joined: 08 Jan 2013 11:41

Re: Using "Photos" in Windows 10 with XYplorer

Post by Starhowl »

However, if you do the following: (1) open Photos using a Customized File Association like "Photos" {:Image}>::run """explorer.exe"" shell:appsFolder\Microsoft.Windows.Photos_8wekyb3d8bbwe!App"; and (2) in the "Settings" option within Photos add your folder of pictures, (3) when you use the XYplorer "Open with..." menu on right click of an image or (Ctrl+Alt+Enter), Photos opens and then you can select an image from your image folder, it will have the arrows. It's a convoluted way, but that's all I can suggest...at least for now. Let us all know if you come up with a more direct way.
I tried the suggested steps, but it's still not possible to browse via the Microsoft Photos App through pictures. Do you have an idea what the reason for it might be?
Attachments
Set file association
Set file association
XYplorer file association.JPG (55.79 KiB) Viewed 6438 times
Pictures-folder in XYplorer
Pictures-folder in XYplorer
XYplorer.JPG (134.65 KiB) Viewed 6438 times
Folders in Microsoft Photos App
Folders in Microsoft Photos App
folders.JPG (21.34 KiB) Viewed 6438 times

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy »

I'm not sure if you understood, but you are not going to be able to do what you really wanted. What you can do is: that Customized File Association will open Photos and when it opens make sure you are are in
"Collections" or "Folders" tabs or sections at the top of Photos (you have already stated you've added your image folder). When you click on one of your images within Photos it will have the arrows. Like I said it's a convoluted way of getting there. You should see something like this...hopefully.
Photo view_capture.JPG
Photo view_capture.JPG (206.28 KiB) Viewed 6432 times
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

ecatomlee
Posts: 2
Joined: 23 May 2019 20:33

Re: Using "Photos" in Windows 10 with XYplorer

Post by ecatomlee »

I have found the solution, https://apps.microsoft.com/store/detail ... a-jp&gl=jp , NeeView is an alternative that works well with xyplorer, it allows you to switch between images. nmo is from microsoft but you should try it. post date is in english :kidding:

Post Reply