• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 'Make new attachment' dilemma
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Make new attachment' dilemma


  • Subject: Re: 'Make new attachment' dilemma
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 27 May 2015 14:38:01 +0200


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





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: 'Make new attachment' dilemma
      • From: Shane Stanley <email@hidden>
References: 
 >Re: 'Make new attachment' dilemma (From: Brian Christmas <email@hidden>)
 >Re: 'Make new attachment' dilemma (From: Shane Stanley <email@hidden>)
 >Re: 'Make new attachment' dilemma (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: 'Make new attachment' dilemma
  • Next by Date: Re: 'Make new attachment' dilemma
  • Previous by thread: Re: 'Make new attachment' dilemma
  • Next by thread: Re: 'Make new attachment' dilemma
  • Index(es):
    • Date
    • Thread