• 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
Run Apple Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Run Apple Script


  • Subject: Run Apple Script
  • From: Ashutosh Kumar Awasthi <email@hidden>
  • Date: Fri, 01 Apr 2005 23:45:25 +0530

Hi All,
 
I have written an application that is calling an apple script it is running fine on mac os x but when i am running the same on mac os 9 it is compiling not running.
it is giving error -1752.
 
i have done like this.
 
 
 
OSStatus err;
ComponentInstance theComponent = NULL;
OSAID contextID = kOSANullScript;
OSAID resultID = kOSANullScript;

theComponent = OpenDefaultComponent( kOSAComponentType, typeAppleScript ); // Here i am getting Error -1752 on mac os 9.
 if ( theComponent == NULL ) { err = paramErr; goto Bail; }

err = OSALoad( theComponent, scriptData, kOSAModeNull, &contextID ); // Compile the script into a new context
require_noerr( err, Bail );

err = OSAExecuteEvent( theComponent, theEvent, contextID, kOSAModeNull, &resultID ); // Run the script

if ( resultData != NULL ) // Collect the results - if any
{
AECreateDesc( typeNull, NULL, 0, resultData );
if ( err == errOSAScriptError )
OSAScriptError( theComponent, kOSAErrorMessage, typeChar, resultData );
else if ( (err == noErr) && (resultID != kOSANullScript) )
OSADisplay(theComponent, resultID, typeChar, kOSAModeNull, resultData);
}

Bail:
if ( contextID != kOSANullScript ) OSADispose( theComponent, contextID );
if ( resultID != kOSANullScript ) OSADispose( theComponent, resultID );
if ( theComponent != NULL ) CloseComponent( theComponent );
return( err );
}
Thanks in Advance
Ashutosh kumar awasthi
 _______________________________________________
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: Re: folder order
  • Next by Date: Re: asx file creation
  • Previous by thread: Re: Mac vs unix Carriage returns on a text file format
  • Next by thread: Re: asx file creation
  • Index(es):
    • Date
    • Thread