Le 23 oct. 2010 à 01:23, Robert Poland a écrit :
Hi,
I have this script that works on My 27" iMac and works on my MBP but never works on my sisters older iMac. They all run OS 10.6.4. destFldr is set for appropriate machine.
I even tried a "new user".
I have stripped out almost everything and got rid of arbitrary items, see below.
Anyone got any more thoughts?
-- on run
set droppedItems to (choose file with prompt "Choose an image file:") as list
open (droppedItems)
-- end run
on open (droppedItems)
set destFldr to "Macintosh HD:Users:rpoland:Documents:" & "scaled_picture_folder_Originals:"
-- set destFldr to "iMac_HD:Users:RLP:Documents:" & "scaled_picture_folder_Originals:"
set the text item delimiters of AppleScript to {""}
tell application "Finder"
open destFldr
repeat with aFile in droppedItems
set theFile to (aFile as string)
set theName to the name of file aFile
set destFldr to destFldr & theName
-- display dialog destFldr as string
display dialog theName as string
tell application "GraphicConverter"
activate
open {alias theFile}
-- delay 10
save window 1 in (destFldr as string)
beep
close window 1
end tell
end repeat
end tell
end open
on open (droppedItems)
set destFldr to "" & (path to documents folder) & "scaled_picture_folder_Originals:"
set the text item delimiters of AppleScript to {""}
tell application "Finder" to open destFldr
repeat with aFile in droppedItems
set theFile to (aFile as string)
if theFile ends with ":" then
set theName to item -2 of my decoupe(theFile, ":")
else
set theName to item -1 of my decoupe(theFile, ":")
end if
set destFldr to destFldr & theName
display dialog theName as string
tell application "GraphicConverter"
activate
open {alias theFile}
repeat
try
name of window 1
exit repeat
on error
delay 1
end try
end repeat
save window 1 in (destFldr as string)
beep
close window 1
end tell
end repeat
end open
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--=====
Yvan KOENIG (VALLAURIS, France) samedi 23 octobre 2010 10:06:27