• 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: Brian Christmas <email@hidden>
  • Date: Wed, 27 May 2015 21:28:47 +1000

G’day again

Out of desperation I tried adding delays where I thought they shouldn’t be necessary, with the former ones removed, and it works now.

A big thank you to Yvan, and also to Shane Stanley, who had input. Everythings much, much faster.

Regards

Santa

on jpegFromClipToPath:thePath compressFactor:compFactor -- 0.0 = max compression, 1.0 = none
try
tell current application to delay 0.2
  set pb to current application's NSPasteboard's generalPasteboard() -- get pasteboard
tell current application to delay 0.2
  set theData to pb's dataForType:"public.tiff" -- get tiff data off pasteboard
if theData = missing value then error "No tiff data found on clipboard"
set newRep to current application's NSBitmapImageRep's imageRepWithData:theData
set theData to (newRep's representationUsingType:(current application's NSJPEGFileType) |properties|:{NSImageCompressionFactor:compFactor, NSImageProgressive:false})
say 18
set theResult to (theData's writeToFile:thePath atomically:true)
say theResult as text
return (theResult = 1)
on error errmsg
tell application "System Events" to display dialog "jpegFromClipToPath " & errmsg
end try
end jpegFromClipToPath:compressFactor:


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