I�m using AppleScript to open photos in Photoshop, resize them, and paste the resulting thumbnails into FileMaker Pro. Unfortunately, since some files are larger than others, some take a lot longer than others and the AppleScript continues on without waiting for Photoshop to finish. This is what I�m trying to do:
Code:
--Get the name of the file and copy the path for FileMaker Pro.
set filename to the name of (file i of folder named dayf of folder named monthf �
of folder named yearf of folder "STORAGE: Digital Pictures")
if (character ((length of filename) - 2) of filename is "m") then
exit repeat
end if
set filepath to ("==STORAGE: Digital Pictures:" & yearf & ":" & �
monthf & ":" & dayf & ":" & filename) as string
set the clipboard to filepath as string
--Have FileMaker Pro find the appropriate record.
tell application "FileMaker Pro"
activate
repeat
try
do script "Find from AppleScript"
if filepath is not "" then
exit repeat
end if
end try
end repeat
do script "Find from AppleScript"
end tell
--Tell Photoshop to open the appropriate file and create a thumbnail version for FileMaker,
--then wait for FileMaker process it.
using terms from application "Finder"
tell application "Adobe Photoshop 7.0"
activate
open (("STORAGE: Digital Pictures:" & yearf & ":" & �
monthf & ":" & dayf & ":" & filename) as alias)
end tell
end using terms from
tell application "Adobe Photoshop 7.0"
do script "Resize for FileMaker Pro"
end tell
--Tell FileMaker Pro to paste the thumbnail that Photoshop just created.
tell application "FileMaker Pro"
activate
do script "Paste from AppleScript"
end tell
End code
So� any ideas?