Nie korzystałem zbyt często z iPhoto, ale używam AppleScript od dłuższego czasu. Zgaduję, że przycisk Enhance
znajduje się w menu Edit
. Jeśli to prawda, to możesz...
tell application "System Events" to tell process "iPhoto" to click menu item "Enhance" of menu "Edit" of menu bar 1
Powiedziałeś, że masz tysiące zdjęć, które wymagają ulepszenia. AppleScript jest idealny do robienia takich rzeczy. Aby całkowicie to zautomatyzować (wczytać obrazy i je ulepszyć), można użyć kropelki, jak pokazano tutaj:
on open the_images
repeat with i from 1 to the count of the_images
set this_image to item i of the_images as alias --the current image
--Verify that the file is actually an image and not just a random file
tell application "Finder"
if (this_image) as string does not end with ":" then --a folder, cannot use
if the name extension of this_image is in {"jpg","tif","gif","png","psd"} then --add additional extensions as needed
--This is an image, so enhance it
my enhance(this_image)
else
display dialog "The file " & name of this_image & " is not an image. It cannot be enhanced." buttons{"OK"} default button 1
end if
else
display dialog "The folder " & name of this_image & " is not an image. It cannot be enhanced." buttons{"OK"} default button 1
end if
end tell
end repeat
end open
on enhance(this_image)
tell application "iPhoto"
activate
open this_image
end tell
tell application "System Events" to tell process "iPhoto" to click menu item "Enhance" of menu "Edit" of menu bar 1
tell application "iPhoto" to close this_image
end enhance
EDYCJA: Powyższy kod nie będzie działać (nie usunąłem go, żeby pokazać, czego inni nie powinni robić), ale ten powinien...
tell application "iPhoto"
set the_images to (get the selection) as list
repeat with i from 1 to the count of the_images
set this_image to item i of the_images
my enhance()
save this_image in this_image
end repeat
end tell
on enhance()
tell application "System Events" to tell process "iPhoto" to click menu item "Enhance" of menu "Edit" of menu bar 1
end enhance
Przepraszam, jeśli ten też nie działa; Jestem zupełnie nowy w iPhoto i staram się, jak mogę. :S
EDIT2: OK, przepraszam. Powyższy skrypt nie działa (nie został usunięty, aby pokazać, czego inni nie powinni robić). To prawdopodobnie nie zadziała, ale mimo wszystko spróbuj...
tell application "iPhoto"
set these_images to (get the selection) as list
repeat with i from 1 to the count of these_images
set this_image to item i of these_images
my enhance(this_image)
save this_image in this_image
end repeat
end tell
on enhance(this_image)
tell application "System Events"
tell process "iPhoto"
keystroke return
--possible pseudo-code
click menu item "Edit" of menu bar 2
click menu item "Enhance" of menu "Quick Fixes"
--end possible pseudo-code
end tell
end tell
end enhance
:S
@Downvoter: Chcesz wyjaśnić?
person
fireshadow52
schedule
23.07.2011