3 Replies Latest reply: Jan 18, 2013 10:16 PM by red_menace
madelefant Level 1 Level 1

Ive been working on some applescripts (10.6 os) and I've noticed there is a large difference between running a script from the script editor as opposed to from a compiled application. The app for is much slower.  Also, in my reading application bundles are discussed but the only bundle option available when saving is a script bundle (extension scptd). Not sure how script bundle differs from application bundles or the lack of a separate save option for application bundle affects a compiled app. If I wan't to be sure a custom icon travels with the app what is the best way to embed it?

 

Anyone know why compiled apps are slower than running the script from applescript?

 

Mike

Solved by Hiroto on Jan 18, 2013 10:07 PM Solved

Hello madelefant

 

It's a well-known fact. Please see the following thread and the threads linked there.

 

Execution speed of Applescript "script" vs "application"

https://discussions.apple.com/thread/2189505

 

Regards,

H

Reply by red_menace on Jan 18, 2013 10:03 PM Helpful

An application needs to be loaded by the system, while the Script Editor (and the script) is already loaded.  Running the application a second time should be faster, since it is already cached.

 

A script bundle is mainly used if you have other scripts or support files that you want bundled together - starting in Snow Leopard, a script application will always be a bundle.

 

The application icon is placed in the /Contents/Resources/ folder of the application bundle, and the file name (along with other configuration items such as the bundle identifier, document types, copyright info, etc) is placed under the appropriate key in the Info.Plist file - see the Information Property List Key Reference.

Reply by red_menace on Jan 18, 2013 10:16 PM Helpful

This might also explain why AppleScriotObjC in Xcode is a bit faster, since everything is a script object.

All replies

  • red_menace Level 6 Level 6
    expertise.desktops
    Desktops

    An application needs to be loaded by the system, while the Script Editor (and the script) is already loaded.  Running the application a second time should be faster, since it is already cached.

     

    A script bundle is mainly used if you have other scripts or support files that you want bundled together - starting in Snow Leopard, a script application will always be a bundle.

     

    The application icon is placed in the /Contents/Resources/ folder of the application bundle, and the file name (along with other configuration items such as the bundle identifier, document types, copyright info, etc) is placed under the appropriate key in the Info.Plist file - see the Information Property List Key Reference.

  • Hiroto Level 5 Level 5

    Hello madelefant

     

    It's a well-known fact. Please see the following thread and the threads linked there.

     

    Execution speed of Applescript "script" vs "application"

    https://discussions.apple.com/thread/2189505

     

    Regards,

    H

  • red_menace Level 6 Level 6
    expertise.desktops
    Desktops

    This might also explain why AppleScriotObjC in Xcode is a bit faster, since everything is a script object.