In case of hard resizing, reset (delete) of Extended Attribute 'com.apple.metadata:kMDItemIsScreenCapture' to avoid potential future spurious dynamic resizing for Retina display.
Optional keeping of file screenshot (Trash)
Automatic ImageMagick path
Screenshot file size optimisation (ImageMagick)
Display Screenshot file information (time stamp, dimensions, type, size)
Display Screenshot file information (time stamp, dimensions, type, size)
2017/10/18 Version 1.1
Stronger and simpler automatic ImageMagick path, suggested by @Tom
2017/10/28 Version 1.2
In case of resizing (resampling 50%) reset (delete) of Extended Attribute 'com.apple.metadata:kMDItemIsScreenCapture' (avoid potential future spurious dynamic resizing for Retina display).
Renaming of the macro by consistency with forthcoming companion 'floating' macros 'Floating Window - Post Capture' & 'Floating Window - Clipboard Text'.
Thanks, Tom. Nope, I was just ignorant. I should have known that Tool-Man Tom would know all of this sort of stuff! I have learned about so many great tools from @Tom, that it is unbelievable.
I do not have, nor have used, ImageMagick. But clearly, I've been missing out on something big. So, it is now near the top of my to-do list.
Thanks for the update, alain.
I did read the Comment, but it was not clear to me whether those were features of the original macro, or of your macro. May I suggest that you add this block to the top of your OP, so it will be explicitly clear to all.
Since ImageMagick seems to be a major feature, it might also be worth a word or two about it.
Just so you know, my SOP is to NOT download macros unless I find something interesting/compelling in the description provided for the macro.
@alain, it looks like you have a clever, useful macro, but since I have limited knowledge about shell scripts, I never run a macro with them until I understand exactly what the scripts do. A Comment just before each Execute Script would be very helpful.
I have downloaded and read your macro, and I have these questions:
Is there any setup/install required BEFORE I run your macro?
If so, please provide complete details
Do I need to install "screencapture"?
Do I need to install "ImageMagick" ? (now I know the answer is yes from Tom's post)
If you use any temp file storage (and I think you do) you should make this clear in the macro setup, and tell us if you delete all temp files that the macro creates.
In the Group "Initial Setting" you provide several variables, but no info on how they are used. May be obvious to some, but not to others.
You provide a Comment "screencapture".
Is this just for general info?
Is the user expected to do anything, change anything based on this info?
In quite a few Actions you have a path that begins with: /Users/alain/
Do I need to change all of these to my user path?
If so, may I suggest that you use a path of ~/ which will work for all users.
A few screenshots of examples of your macro would be great. Good examples help me decide if I want to download/use a macro.
I'm curious about your method to determine whether or not the user has a retina display.
Since KM provides a %DPI% token, why use a shell script instead of it?
If your script relies on the text "Retina: Yes" being found, I wonder if it will work with my external monitor that is high DPI, but is not a retina monitor?
I use a temp file for the resulting screen shot exactly as @iNik does
The user can choose root name and folder.
But here this file is time stamped and trashed (in place to delete) to give user facility to keep the floating screen shot if required.
"screencapture" is one of native BSD Unix (so of OSX) commands, so nothing to install.
The Comment Action help me / user to choose the right parameters.
These Actions are Comment / Execute Shell Script Actions. In the later case there is a "#" prefix which is a comment for shell command: just comments
Selecting a comment as: file:///Users/alain/Documents/Logiciels/!Mac%20OS%20X/!Doc/Mac-OS-X--Unix-BSD/man-pdf/man_screencapture.txt
gives me a direct link to local resources using "Open URL" service
file://~/Documents/Logiciels/!Mac%20OS%20X/!Doc/Mac-OS-X--Unix-BSD/man-pdf/man_screencapture.txt
is more elegant and generic... but unfortunately don't work.
OP will be edited to add a screen shot of a floating screen shot
%DPI% I think you means DPI() function which works with clipboard image, but on the contrary, I avoid to use the clipboard...
Exactly. As I can only test on a Retina MBP with no external display, your own test would be welcome.
Don't worry I will be patient as you are with every of us
I'll second the usefulness of ImageMagick. I use it every day to resize images for publication and this little Keyboard Maestro palette runs a few of the more custom options for me:
I run ImageMagick mostly through its PerlMagick library rather than the command line utilities.
I'm seeing the same behavior that @troy is, i.e. the window is not resizable (and is also much smaller than the window screenshotted and has wide borders on the sides, as you can see here):
I Tried MacPorts and it failed saying dCode was not installed correctly.
I re-installed dCode, then installed ImageMagick via Homebrew with no errors.
I changed this 'pref' in the macro:
** Set Variable “scfs_resize” to Text “YES” **
See included screenshot showing the floating screenshot just taken of the browser.
I’m afraid I’m still not sure from your response if this solved the lack of resizability for you. Did it? On my machine, I made sure scfs_resize was being set to YES and it didn’t seem to change anything when I tested the macro again.