Skip to main content
deleted 115 characters in body
Source Link
property albumNames : {} property albumIDs : {} tell application "Photos" activate  my getAlbumNames(it) -- get all album names and IDs (recursively) setrepeat theSelectionwith toaPhoto in (get selection) -- Getprocess theeach selected photos from Photos repeat with aPhoto in theSelection -- Iterate through each photo     try -- Get the Photo ID set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try  spotlight media item id selectionID -- Tell Photos to 'quick look' -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- Find destination folder's ID and add photo to it repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption, and set them display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption   end repeat end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos" set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames 
property albumNames : {} property albumIDs : {} tell application "Photos" activate  my getAlbumNames(it) -- get all album names and IDs (recursively) set theSelection to (get selection) -- Get the selected photos from Photos repeat with aPhoto in theSelection -- Iterate through each photo     try -- Get the Photo ID set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try  spotlight media item id selectionID -- Tell Photos to 'quick look' -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- Find destination folder's ID and add photo to it repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption, and set them display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption   end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos" set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames 
property albumNames : {} property albumIDs : {} tell application "Photos" activate my getAlbumNames(it) -- get all album names and IDs (recursively) repeat with aPhoto in (get selection) -- process each selected photo try -- Get the Photo ID set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try spotlight media item id selectionID -- Tell Photos to 'quick look' -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- Find destination folder's ID and add photo to it repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption, and set them display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos" set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames 
deleted 125 characters in body
Source Link
property albumNames : {} property albumIDs : {} tell application "Photos" activate my getAlbumNames(it) -- get all albumsalbum names and IDs (recursively) my getAlbumNames(it)   set theSelection to (get selection) -- Get the selected photos from Photos set   theSelection to (get selection)   repeat with aPhoto in theSelection -- Iterate through each photo   repeat with i from 1 to count theSelection   set aPhoto to item i of theSelection     try -- Get the Photo ID for adding MetaData try set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try   -- Tell Photos to 'quick look' spotlight media item id selectionID  -- Tell Photos to 'quick look' -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- TellFind thedestination Albumfolder's thatID thisand photoadd isphoto nowto addedit repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption, and set them display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result  display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result       -- Set the Title and caption set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos"  set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames 
property albumNames : {} property albumIDs : {} tell application "Photos" activate -- get all albums names (recursively) my getAlbumNames(it)    -- Get the selected photos from Photos set theSelection to (get selection)    -- Iterate through each photo   repeat with i from 1 to count theSelection   set aPhoto to item i of theSelection     -- Get the Photo ID for adding MetaData try set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try   -- Tell Photos to 'quick look' spotlight media item id selectionID  -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- Tell the Album that this photo is now added repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result  display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result       -- Set the Title and caption set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos"  set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames 
property albumNames : {} property albumIDs : {} tell application "Photos" activate my getAlbumNames(it) -- get all album names and IDs (recursively) set theSelection to (get selection) -- Get the selected photos from Photos    repeat with aPhoto in theSelection -- Iterate through each photo try -- Get the Photo ID set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try spotlight media item id selectionID -- Tell Photos to 'quick look' -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- Find destination folder's ID and add photo to it repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption, and set them display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos" set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames 
Source Link

property albumNames : {} property albumIDs : {} tell application "Photos" activate -- get all albums names (recursively) my getAlbumNames(it) -- Get the selected photos from Photos set theSelection to (get selection) -- Iterate through each photo repeat with i from 1 to count theSelection set aPhoto to item i of theSelection -- Get the Photo ID for adding MetaData try set selectionID to id of aPhoto on error errorMessage set ATID to AppleScript's text item delimiters set AppleScript's text item delimiters to "\"" set selectionID to text item 2 of errorMessage set AppleScript's text item delimiters to ATID end try -- Tell Photos to 'quick look' spotlight media item id selectionID -- Ask the user to choose the Album(s) this photo should go into set theAlbumChoice to choose from list albumNames with prompt "Where should this photo go?" if theAlbumChoice is false then return -- Tell the Album that this photo is now added repeat with k from 1 to count albumNames if (item 1 of theAlbumChoice) is (item k of albumNames) then set theAlbumID to item k of albumIDs exit repeat end if end repeat add {media item id selectionID} to album id theAlbumID -- Ask for Title and Caption display dialog "What's the Title of this Photo?" default answer "" set theTitle to text returned of result display dialog "What's the Caption of this Photo?" default answer "" set theCaption to text returned of result -- Set the Title and caption set name of media item id selectionID to theTitle set description of media item id selectionID to theCaption end repeat end tell on getAlbumNames(aFolder) -- recursive handler tell application "Photos" set albumNames to albumNames & name of albums of aFolder set albumIDs to albumIDs & id of albums of aFolder repeat with subFolder in (get folders of aFolder) my getAlbumNames(subFolder) end repeat end tell end getAlbumNames