Re: image event help
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