Automator workflow for copying screenshots to clipboard - automator

I want to create an Automator Workflow that will automatically move screenshots I take with cmd+shift+3/4 to a specified folder and at the same time also copy the screenshot I took to my clipboard. I already got automator to move the files, but the action 'Copy to Clipboard' which I added, only copies the name of the file to the clipboard, not the image itself. Automator does show the selected screenshot as a result of my 'Copy to Clipboard'-action though. Any ideas how to get the screenshot I took into my clipboard with automator?

I found the solution here
I set it up so that this is a folder action that runs on my desktop folder.
on run {input, parameters}
set thisFile to item 1 of input
set the clipboard to (read thisFile as TIFF picture)
return thisFile
end run

Related

How can I get the full path a folder drag and dropped into a file input in Electron just like how you can drag and drop one into a mac terminal?

On mac you can "Drag the file or folder to the Terminal window. The item’s absolute path appears on the command line." How can I achieve this in an Electron Application?
I've been trying various react file upload libraries like react-dropzone and react-filepond. Both "allow" for directories to be uploaded but in reality they both upload the entire contents of the directory. I only need the directories full path.

Command copypng failed with exit code 71

When I try to build an iOS application the XCode gives me the error which says
error: can't exec 'copypng' (No such file or directory)
Command copypng failed with exit code 71
So the problem isn't in missing PNG files or something like this, the problem is in the file that should does copy. I met this error for the first time and google says nothing.
How do I fix it?
I guess you stated, that you want to copy file, while there is no such file. Go to Project->Target->Build Phases->Copy Bundle Resources and find 'copypng' file (should be highlighted in red), and delete it (as it doesn't exist anymore).
On image attached to your question I see info that system couldn't copy files LaunchScreen-iPhoneLandscape.png and LaunchScreen-iPhonePortrait.png.
Normally, if you have Images.xcassets in project there should be "LaunchImage" image set. But it is alsoo possible that these .png files are placed directly in resources. Name for launch image used by target is set in "Asset Catalog Launch Image Set Name" in target's Build Settings. Make sure name for Launch image in xcassets (or in .png file in targets sources) matches.
If they are, check if target membership is correct (otherwise they won't be seen by compiler). Last thing to check - check potential problems with LaunchImage files according to the instructions in link from Adamsor comment.
For example - check if all necessary file sizes are in place, try opening and re-saving these images in editor. Maybe format is not right and that will be enough to fix it.
I've reinstalled XCODE and now all is ok.

Application icon stuck DELPHI XE5

The first time i update the icon in "project > Options > Application > Load Icon..." the icon as changed as it should, now every time i change the application icon, my app keep compiling with The old icon even if i click in "project > Options > Application > Default" or try to load a new one
The icon get stuck somewhere, but where ?
There's a way to force icon with resource file or unstuck the old icon ?
I download a icon which is a multi size ico file ( one ico file, 8 sizes )
i already try :
Reboot my computer.
Change the .exe name.
Copy the .exe to another computer.
same error.
For Windows platform, the icon (and version info) is stored in resource file (.res). And by default Delphi project includes in exe all the .res files it founds in project directory (see {$R *.res} directive in your .dpr file).
So check all the .res files you have in your project directory to find out which of contains the default icon. You can use any resource editor for that.
Then, just delete that file, but please keep backup, cause .res file may contain other important information.
Had the same experience recently as well.
The "default" button does not seem to work as soon as you have selected an icon.
I got rid of the icon via the following steps:
Close your project.
In your project folder an icon will be created with the name "Projectname"_ICON.ICO.
Rename or remove this Icon.
Reopen your project,
Get to Project->Options,
An error message will be raised at every configuration in which you have used the icon, but by pressing default the message will not reappear,
Now the project is forced to use the default icon again.
Probably there is a more sophisticated manner, but I have not found it elsewhere.
This was what helped me:
You can just run the following command to clear the icon cache:
ie4uinit.exe -ClearIconCache
For Windows 10, use:
ie4uinit.exe -show

Xcode isn't copying the files in my folder

During my build my files arent always copied. Even when i modify them.
Its a web app im building and the folder that isnt copying is:
HTML (blue folder icon) it references a HTML folder on disk.
It doesnt seem to copy.
I've tryed doing a run script saying
Shell: /bin/sh
Script:
touch -cm ${SRCROOT}
And it makes no differnece.
How can i FORCE xcode to always copy every file?
E.g a script to touch every file and folder to make sure it copies?
Im a a dead end here!
A blue folder represents a folder reference, which is a kind of file reference, just like all the references to .h and .m files in your project.
The only modification time Xcode cares about is that of the referenced item—in this case, the folder. Not that of any item in the folder, nor of any descendant item, nor of any ancestor folder (such as your project directory, which is what $SRCROOT refers to).
So, you need to touch the folder specifically. Any time you modify anything in the folder, you need to touch that folder.
This doesn't apply if you add or delete files in the folder, since that counts as modifying the folder itself.
If you really want to unconditionally copy the folder every time, you can create a shell script phase before the Copy Files phase that takes the folder as an input and produces it as an output, and touches that folder specifically. Then the Copy Files phase after it will see that the folder has been “modified” and will re-copy it.
Expect long build times if you do that.

Testing ASP.NET MVC website

I'm working on an MVC site with an image upload capability and I want to write a test that will upload an image.
I made an image called TestImage.jpg and set Copy to Output to be "Copy if Newer". In my test I try to load that with the following code:
System.Drawing.Image testImage = System.Drawing.Image.FromFile(#"TestImage.jpg");
Shouldn't the "Copy to Output" copy it to the same directory where the test is running? If not, how can I find out where it was copied to? Best would be some kind of project root relative path so I can feel free to move the solution around without this breaking.
In MSTest, the framework copies all .dlls to a folder called TestResults. Unfortunately, it only copies .dlls, .pdbs and .configs from the output folder to the TestResults folder, so your files are not being copied.
To copy those files, you will need to either
add the DeploymentItem attribute to the test(s) in question
edit your .testrunconfig file by adding the appropriate files in the Deployment tab
A better alternative is to embed the test-specific files in the test as an embedded resource and then read them directly from the resource stream.
in the solution explorer Under solution items double click LocalTestRun.testrunconfig go to deployment and add the image
http://img17.imageshack.us/img17/5219/sanstitrelca.jpg

Resources