• 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: image event help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image event help


  • Subject: Re: image event help
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 20 Oct 2010 14:21:51 -0700

On Oct 20, 2010, at 1:55 PM, Paul Abney wrote:

The following snippet sometimes works, and sometimes fails at the line 
set imgInfo to properties of theImg with the error theimg is not defined
Yet I run the script again and it works. Any clues as to what I am doing wrong?

repeat with i from 1 to number of items in pdfs_folder
set this_item to item i of pdfs_folder as alias
tell application "Image Events"
set theImg to open this_item
set imgInfo to properties of theImg
close theImg
copy dimensions of imgInfo to {W, H}
copy resolution of imgInfo to {WR, HR}
end tell

Hi Paul,

Perhaps your pdfs_folder contains non-PDF files—most likely invisible files or folders such as ".DS_Store" or ".Trash". Validate each item before opening it with Image Events, and skip those that aren't PDFs. For example, you can use System Events or the Standard Additions to check the value of their "visible" and "file type" properties.

HTH,
Stan C.

 _______________________________________________
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

References: 
 >image event help (From: Paul Abney <email@hidden>)

  • Prev by Date: Re: Changing "open with" (Mac Finder) for certain files
  • Next by Date: Re: Applescript international language
  • Previous by thread: image event help
  • Next by thread: Fwd: Delivery Status Notification (Delay)
  • Index(es):
    • Date
    • Thread