• 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
Image events error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Image events error


  • Subject: Image events error
  • From: Ronan O Ciosoig <email@hidden>
  • Date: Sun, 15 Mar 2009 23:49:41 +0100

Anyone know what the error " Image Events got an error: Can’t get «class psxf» " means? 

When I run the app I get this: 

MacDev:mobilePics <user>$ ./scaleAllImages.pl ./
Scaling new image file: /Users/<user>/Pictures/mobilePics/DSC00005_sm.JPG
/Users/<user>/Documents/AppleScripts/scaleImage.scpt: execution error: Image Events got an error: Can’t get «class psxf» "/Users/<user>/Pictures/mobilePics/DSC00005_sm.JPG". (-1728)


TIA,
Ronan.



I am calling an AppleScript with a perl script: 

#!/usr/bin/perl -w

use strict;

my $scaleCommand = "/usr/bin/osascript /Users/<user>/Documents/AppleScripts/scaleImage.scpt";

my $imageFile;
my $path = shift;
my @imageFiles = `ls $path | grep JPG`;
my $imageSmall = "_sm";
my $imageSuffix = ".JPG";
my $fullPath = `pwd`;
chomp $fullPath;

foreach $imageFile (@imageFiles) {
    if($imageFile =~ m/$imageSuffix$/) {
        chomp $imageFile;
        my($file,$suffix) = split('\.', $imageFile);
        my $newFile = $file . $imageSmall . $imageSuffix;
        `cp $imageFile $newFile`;
        my $pathToImage = $fullPath . "/" . $newFile;
        print "Scaling new image file: " . $pathToImage . "\n";
        `$scaleCommand $pathToImage`;
    }
}


on run argv
set imageFile to item 1 of argv


tell application "Image Events"
launch
set thisImage to open POSIX file imageFile
scale thisImage by factor 0.4
save thisImage with icon
close thisImage
end tell
end run

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Image events error
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: Is this a bug?
  • Next by Date: Re: Scripting the Colors palette
  • Previous by thread: Re: Scripting the Colors palette
  • Next by thread: Re: Image events error
  • Index(es):
    • Date
    • Thread