Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: When will compiled scripts be stored in the data fork?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When will compiled scripts be stored in the data fork?



on 3/27/01 2:20 AM, Marco Piovanelli at email@hidden wrote:

> Indeed the latest version of the Script Editor (1.6) can
> open data fork scripts, where the compiled script data is
> stored in the data fork rather than an 'scpt' resource.
> Mac OS X comes with a bunch of such scripts (e.g., in
> Applications/AppleScript/Example Scripts/). Most of them
> have a ".scpt" file extension, but some use ".as".

If you search with Sherlock for files having the ".as" file extension, you
find that they all are described as type "AppleScript Text". There are
several of them, all named "CodeLister.as" or "PDFFileOpener.as". They are
all associated with Apple developer documentation. If you double-click one
of them, Script Editor launches and opens it, but all you see is a mixture
of garbage text and plain text. The plain text is in the nature of code
comments. I have no idea what these are, but they apparently are not meant
to be used by the likes of us. They seem to be some sort of aid to readers
of the documentation.

If you search for files having the ".scpt" extension, you find that they all
are type "compiled script". All of them are in the Example Scripts folder in
the AppleScript folder of Applications. These are real, editable scripts
that can be edited and run in Script Editor and run in Script Runner.

There are also a number of scripts installed by Mac OS X that have no file
extension and are apparently old-style compiled scripts. A large number of
ColorSync scripts are in the Scripts folder of the ColorSync folder in the
root-level Library folder. Several very complex and interesting Image
Capture scripts are in the Scripts folder of the Image Capture folder in the
Library folder.

> I don't know about the special (file) type, though.
> File types don't seem to matter much in OS X.
> Which raises an interesting question: how is a script
> editor (or any application that can open compiled scripts)
> supposed to recognize data fork scripts?

The convention in Mac OS X is that files without creator/type resources
should have file extensions like ".scpt". Applications (and scripts) have to
search for both ways of identifying a file's type. Files can use both
techniques simultaneously for indicating their type, so you can't use this
alone as way to distinguish between old-style files with resources and
new-style flat files. I would suppose you can detect a data fork script file
by a combination of testing for the existence of a resource fork (if none,
it certainly isn't an old-style script), and looking for the ".scpt" file
extension.

From another mailing list:

on 3/26/01 7:46 PM, Ali Ozer at email@hidden wrote:

> Apple recommends that applications strive to work well with file
> extensions as well as types/creators. For instance, documents should be
> recognized whether they have just a type or just a file extension. When
> saving documents, especially those that are likely to be placed on the
> web or shared with other platforms, apps should provide file extensions
> in addition to types.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA

The AppleScript Sourcebook - www.AppleScriptSourcebook.com
Vermont Recipes - www.stepwise.com/Articles/VermontRecipes


References: 
 >Re: When will compiled scripts be stored in the data fork? (From: Marco Piovanelli <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.