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: Display dialog with image



	Thanks to Yvan and Christian, here's how we're handling previewing images. Works like a charm!

> set imageFiles to choose file with prompt "Select Image Files" with multiple selections allowed
> PreviewImages(imageFiles)
> on PreviewImages(imageFiles)
> 	repeat with myFile in imageFiles
> 		tell application "Finder"
> 			reveal myFile
> 			-- a "tell Finder window 1" tell block fails on some of these commands
> 			set current view of Finder window 1 to icon view
> 			set shows item info of icon view options of Finder window 1 to true
> 			set shows icon preview of icon view options of Finder window 1 to true
> 			set icon size of icon view options of Finder window 1 to 128
> 			set bounds of Finder window 1 to {30, 50, 350, 350}
> 			reveal myFile
> 			activate
> 			set userChoice to display dialog "Enter image caption" buttons {"Show Preview", "Cancel", "Okay"} default answer ""
> 			
> 		end tell
> 		if the button returned of the userChoice = "Show Preview" then
> 			tell application "Preview"
> 				open myFile
> 				activate
> 				set userChoice to display dialog "Enter image caption" buttons {"Cancel", "Okay"} default answer ""
> 				try
> 					tell application "System Events"
> 						tell process "Preview"
> 							keystroke "w" using {command down} 
> 						end tell 
> 					end tell 
> 				on error -- in case system events isn't aware
> 					quit
> 				end try
> 			end tell
> 		end if
> 	end repeat
> end PreviewImages
> 
	 Thanks

	ES
 _______________________________________________
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



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.