Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get iPhoto's pictures



... I would try to develop a little program that ... read the iPhoto's data and make a window like the import window embedded in a lot of programs.


Sample code :

-- File to save selected photo(s) information.
set file_Path to (((path to desktop from user domain) as string) & "iPhoto_Info.txt")


-- Delete file ('~/Desktop/iPhoto_info.txt'), if it exists.
tell application "Finder" to if (exists file file_Path) then (delete file file_Path)


tell application "iPhoto"
 launch

 set tPhotos to selection -- Obtain all selected (in 'iPhoto') photos.

-- Use a string to contain the information of each selected photo.
set tString to ("Number of selected photos: " & ((count tPhotos) as string) & return & return)


repeat with i in tPhotos -- Cycle through the selected photos.
-- Obtain photo information of each selected file.
set {tName, tComment, tDate, tDimensions, tHeight, tId, image_Filename, image_path, thumbnail_filename, thumbnail_path, tTitle, tWidth} to {(name of i), (comment of i), (date of i), (dimensions of i), (height of i), (id of i), (image filename of i), (image path of i), (thumbnail filename of i), (thumbnail path of i), (title of i), (width of i)}


-- One way to create a string of selected photo's information.
set temp_String to ("Name: " & tName & return & "Comment: " & tComment & return & "Date: " & tDate & return & "Dimensions: " & tDimensions & return & "Height: " & tHeight & return & "ID: " & tId & return & "Image Filename: " & image_Filename & return & "Image Path: " & image_path & return & "Thumbnail Filename " & thumbnail_filename & return & "Thumbnail Path: " & thumbnail_path & return & "Title: " & tTitle & return & "Width: " & tWidth)
set tString to (tString & temp_String & return & return & " ----------- " & return & return)


display dialog temp_String -- Optional. Display photo information of each selected (in 'iPhoto') photo.
end repeat


-- Optional. Save list of photo(s) information into a file ('~/Desktop/iPhoto_info.txt').
set fRef to open for access file file_Path with write permission
write tString to fRef
close access fRef
end tell


set the clipboard to tString -- Optional. Place list of photo(s) information onto the 'clipboard'.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden


This email sent to email@hidden
References: 
 >Get iPhoto's pictures (From: "Karim Gorjux" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.