Anthony Kong Anthony Kong - 6 months ago 61
AppleScript Question

'A end of line can't go after this """' in this applescript

I am writing an applescript to iterate thru all photo in the default album 'Photos'

enter image description here

Here is my script:

tell application "Photos"
activate
set alls = albums "Photos"
repeat with photo in alls
say photo.name
end repeat
end tell


Line 3. throws the following syntax error:

enter image description here

I am new to this language and I am unable to find an remedy to the incorrect syntax. Can any one point out what is amiss here?

Answer Source

If you refer to the dictionary it helps to understand how each element is contained by other elements. To get the photos of all albums you have to loop through the media items of every album. This will get the filename of each photo.

tell application "Photos"
    activate
    set alls to every album
    repeat with photoAlbum in alls
        set photos to every media item in photoAlbum
        repeat with photo in photos
            get filename of photo
        end repeat
    end repeat
end tell
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download