Thema:
Re:MacOS: Tastatur-Shortcut als Desktop-Icon speichern flat
Autor: pacmanamcap
Datum:11.02.23 13:51
Antwort auf:Re:MacOS: Tastatur-Shortcut als Desktop-Icon speichern von Chris B

write a script to save a screenshot on mac os.

Here's a simple AppleScript script that will take a screenshot on a Mac and save it to the desktop:

vbnet

tell application "System Events"
   tell process "Screencapture" to keystroke "4" using {shift down, command down}
end tell

tell application "Finder"
   set desktopPath to (path to desktop folder as text)
   set dateString to do shell script "date +'%Y-%m-%d-%H-%M-%S'"
   set fileName to "screenshot-" & dateString & ".png"
   set filePath to desktopPath & fileName
   set theFile to (desktopPath & fileName) as alias

   repeat while theFile exists
       set dateString to do shell script "date +'%Y-%m-%d-%H-%M-%S'"
       set fileName to "screenshot-" & dateString & ".png"
       set filePath to desktopPath & fileName
       set theFile to (desktopPath & fileName) as alias
   end repeat

   delay 1
   move (the last item of (get every file of desktopPath whose name starts with "Screen Shot")) to theFile
end tell

This script will save a screenshot of a selected area as a PNG file to the desktop, with a filename in the format screenshot-YYYY-MM-DD-HH-MM-SS.png. If a file with that name already exists, the script will append a timestamp to the filename to ensure that it's unique.
wilhelm-sven@live.de
Can you tell me what i have to do to save this script as an icon on desktop?

To save the above AppleScript script as an icon on your desktop, follow these steps:

   Open AppleScript Editor (you can find it in the "Utilities" folder within the "Applications" folder).
   Copy and paste the script into the AppleScript Editor.
   Go to "File" > "Export" and select "Application" as the file format.
   Give the application a name, choose a location to save it, and then click "Save".
   Navigate to the location where you saved the application, right-click on it, and select "Get Info".
   In the "Get Info" window, go to the "General" section, and check the box next to "Open in 32-bit mode" (if available).
   Close the "Get Info" window.
   Drag the application to your desktop to create a shortcut.

You can now run the script by double-clicking on the icon on your desktop. This will take a screenshot of a selected area and save it to the desktop.


==============

probier ich nachher aus


< antworten >