• 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 Events problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Image Events problem


  • Subject: RE: Image Events problem
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 15 Sep 2006 08:45:04 -0700

On Sep 14, 2006, at 9:52 PM, Simon Whitaker wrote:

try
	set _jpeg_file to (path to desktop as string) & "test.jpg"
	set _pict_file to (path to desktop as string) & "test.pict"

	tell application "Image Events"
		launch
		set image_data to open file _jpeg_file
		tell application "Finder" to set new_item to _pict_file
		save image_data in new_item as PICT
		close image_data
	end tell
on error e
	return {e, number of e}
end try

It works for me.

By the way the line
tell application "Finder" to set new_item to _pict_file
is totally unnecessary. just use _pict_file in the next line; no need to use new_item at all.


And if you do have a need elsewhere that causes you to use new_item, there's no need for the Finder to tell it; just assign the variable.

It is curious that you don't have to precede the path name with "file" when saving, but can use the string itself.

-- Michelle

--
"No" is not a bad word.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Mixing Audio / Video / Podcasts in a single user playlist
  • Next by Date: RE: Image Events problem
  • Previous by thread: Re: Image Events problem
  • Next by thread: RE: Image Events problem
  • Index(es):
    • Date
    • Thread