Le 27/05/2015 à 13:45, Brian Christmas < email@hidden> a écrit :
Thanks Shane, I’ll implement that straight away.
Regards
Santa
On 27 May 2015, at 9:40 pm, Shane Stanley < email@hidden> wrote: On 27 May 2015, at 9:28 pm, Brian Christmas < email@hidden> wrote:
Out of desperation I tried adding delays
Delays make more sense in loops, like this:
set pb to current application's NSPasteboard's generalPasteboard() -- get pasteboard repeat with i from 1 to 10 -- some limit tell current application to delay 0.1 set isOK to (pb's |types|()'s containsObject:"public.tiff") if isOK as boolean then exit repeat if i = 10 then -- there's a problem; handle it end if end repeat set theData to pb's dataForType:"public.tiff" -- get tiff data off pasteboard
I'm really puzzled. Here the script behaves flawlessly with the original loop or with the new one which is more logical than the first one.
While eating I had an idea for a third version :
repeat if ((clipboard info) as text) contains "TIFF picture" then exit repeat end repeat
Here it behaves exactly as the other two and as Shane's late one.
Is the fact that I am running Os X from a SSD may explain the different behaviors we get ?
Auxiliary question, probably for Shane :
If I want to edit the handler to create other file formats, I know that I may replace NSJPEGFileType by one of these other formats : NSBMPFileType, NSGIFFileType, NSPNGFileType, and NSTIFFFileType but I don't know if I must continue to use |properties|:{NSImageCompressionFactor:compFactor, NSImageProgressive:false} May you tell if I must do ?
Yvan KOENIG (VALLAURIS, France) mercredi 27 mai 2015 14:37:57
|