In OS X Lion, when I press cmd+shift+4 and then space, I take a screenshot of an app.
But I use my OS in Spanish, and the screenshot file name is very long with spaces and "(,)" chars.
Captura de pantalla 2011-09-25 a la(s) 15.25.54.png
How can I change the default name of screenshots?
答案1
From Apple discussions:
sudo su
cd /System/Library/CoreServices/SystemUIServer.app/Contents/Resources/Spanish.lpro j
plutil -convert xml1 ScreenCapture.strings
vim ScreenCapture.strings
Change
<key>%@ %@ at %@</key>
<string>%@ %@ a la(s) %@</string>
to
<key>%@ %@ at %@</key>
<string>%@ %@_at_%@</string>
Then:
plutil -convert binary1 ScreenCapture.strings
killall SystemUIServer
答案2
Sounds like you want back the old Leopard-style "Picture 1", "Picture 2" conventions. I don't know if that's something you can customize though. At least not while the screenshots are taken.
Changing the part before the date
A little workaround: The following will remove the "Captura de pantalla" part. Open up a Terminal and enter:
defaults write com.apple.screencapture name -string "screenshot"
killall SystemUIServer
Replace screenshot
with whatever you want your screenshots to be named.
Changing the whole name
If you know that your screenshots land on the desktop anyway, you can of course create an Automator action that automatically changes screenshot file names when they appear on your Desktop (as a so-called "Folder Action"):
Start by opening Automator.app and selecting "Folder Action" as a new action type
For the target folder, select the Desktop.
Drag the "Find Finder items" and "Rename Finder items" actions from the left to the right pane
In the first action, search "Desktop", and under the conditions, select files that begin with "screenshot" (or whatever they are called right now) and are of the kind "image"
For the "Rename Finder items" action, change the type to "Make sequential". Choose a new name for your screenshots.
Save the workflow under any name. Now, it doesn't kick in instantly, so you'll have to wait a bit before your files are renamed. If you want, you can even tweak this script to move your screenshots to a new folder, convert them, et cetera.
To remove this, right-click your Desktop folder, select "Services", "Folder Actions Setup". Uncheck the folder action or disable them completely.
If you ever want to change your workflow, it's located in /Users/your-username/Library/Workflows/Applications/Folder Actions
.
答案3
I've disabled the default shortcuts in System Preferences, and use scripts like:
screencapture -io ~/Desktop/`date '+%y%m%d%H%M%S'`.png
答案4
since Sierra OS X 10.12, the solution with sudo/plutil/vim/... will not work!!!
my workaround: do it with scripts and user defined shortcuts
#!/bin/sh
# Sources
# https://discussions.apple.com/thread/7824154
# https://superuser.com/questions/339702/how-do-i-change-the-default-screenshot-name-in-os-x-lion
UserName="PutHereYourLoginName"
DateJahrMonatTagZeit=`date "+%Y%m%d_%H%M%S"`
FileName="/Users/"$UserName"/Documents/Screenshots/Screenshot "$DateJahrMonatTagZeit".png"
#echo "FileName: $FileName"
echo
# capture screen with Mouse Cursor
echo "screencapture -iox $FileName"
screencapture -iox "$FileName"
# select the window you want to screenshot
#echo "screencapture -wox $FileName"
#screencapture -wox "$FileName"