Using "Photos" in Windows 10 with XYplorer

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

Using "Photos" in Windows 10 with XYplorer

Post by klownboy » 27 Aug 2018 19:52

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)?

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

Re: Using "Photos" in Windows 10 with XYplorer

Post by highend » 27 Aug 2018 20:09

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 highend (at) web (dot) de

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

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy » 27 Aug 2018 20:42

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}";

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

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog » 22 Oct 2018 05:49

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: 2581
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy » 22 Oct 2018 15:50

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).

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

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog » 23 Oct 2018 08:10

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: 2581
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy » 23 Oct 2018 14:39

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:";

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

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog » 09 Nov 2018 02:19

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

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

Re: Using "Photos" in Windows 10 with XYplorer

Post by Dustydog » 16 Nov 2018 00:54

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: 2581
Joined: 28 Feb 2012 19:27

Re: Using "Photos" in Windows 10 with XYplorer

Post by klownboy » 17 Nov 2018 15:29

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.

Post Reply