zu a)
Du kannst einfach alles aus dem Skript streichen, was die Alben für die anderen Formate betrifft:
-- -- copy and paste from here to the en︎d ✄ ✄
set SquareAlbumName to "SquareAlbum" -- change this to the name of the album where you want to collect the Square Photos
-- Album for media files without width and height
set MySkippedName to "SquarelbumSkipped"
-- change this to the name of the album where you want to collect the media items that have no width or height
tell application "Photos"
activate
-- Ensure that the albums do exist
try
if not (exists container SquareAlbumName) then
makenewalbumnamedSquareAlbumName
end if
set theSquareAlbum to containerSquareAlbumName
if not (exists container MySkippedName) then
makenewalbumnamedMySkippedName
end if
set thePanoSkipAlbum to containerMySkippedName
on error errTexttwonumbererrNumtwo
display dialog "Cannot open albums: " & errNumtwo & return & errTexttwo
end try
-- process the selected photos from the All Photos album
try
set imageSel to (get selection)
on error errTexttwonumbererrNumtwo
display dialog "Cannot get the selection: " & errNumtwo & return & errTexttwo
end try
set squares to {} -- the list of square format photos
set skipped to {} -- the list of other media fiiles, not photos or videos
-- check, if the album or the selected photos do contain images
if imageSel is {} then
error "Please select some images."
else
repeat with im in imageSel
try
tell im--get the pixel size
set h to its height
set w to its width
end tell
on error errText number errNum
display dialog "Error: " & errNum & return & errText & "Trying again"
try
delay 2
tell im
set h to its height
set w to its width
end tell
on error errTexttwonumbererrNumtwo
display dialog "Skipping image due to repeated error: " & errNumtwo & return & errTexttwo
end try
end try
set noDimensions to (w is missing value) or (h is missing value)
if noDimensions then
set skipped to {im} & skipped
else
if (w = h) then
set squares to {im} & squares
end if
end if
end repeat
addsquarestotheSquareAlbum
addskippedtothePanoSkipAlbum
return "square photos: " & (length of squares) & ", skipped: " & (length of skipped)
end if
end tell
-- end ✄ ✄
zu b) du kannst den Start des scripts vereinfachen, indem du es als Programm sicherst und zum Dock hinzufügst. dann kannst du es mit einem Klick starten.
Im Script Editor verwende "Ablage > Export" und wähle als Format "Application". Das wird ein ausführbares Program sichern. Wenn du es startest, wir automatisch auch Fotos gestartet.