Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

An error of type -10661 has occurred

I have created a Applscript App (Application Bundle) from 10.5.8 It is not working fine when I run in Snow Leopard-10.6.x machine: An error of type -10661 has occurred.

Can you throw some light around this error message?

Note:
The app is with GUI Scripting, File read/write and Folder Creation.

MacBook Pro, Mac OS X (10.5.8)

Posted on May 17, 2010 11:36 PM

Reply
Question marked as Best reply

Posted on May 19, 2010 6:20 AM

Hello Mowri,

Well, I think that the 'file specication' problem is another story and is not the cause of error -10661 because kLSExecutableIncorrectFormat is to be thrown BEFORE the script is run.

---
As for 'file specification' (typeFSS), it has been deprecated under OSX.
Perhaps 10.6 has finished it.

Instead you can use 'POSIX file' (typeFileURL) or 'file' (typeFile) for both existing and non-existing file system object. And 'alias' (typeAlias) for existing file system object.
(Note that 'file' (typeFile) cannot be used by itself for some reason but only in conjunction with command.)

For example, if you're using 'file specification' for 'open for access' command such as -

set hfspath to "HFS:path:to:new file"
set fss to hfspath as file specification -- # 'file specification' (typeFSS) is deprecated
open for access fss with write permission

you may use 'file' such as -

set hfspath to "HFS:path:to:new file"
--set f to hfspath as file -- # you cannot do this for some reason
--set f to file hfspath -- # NG either
open for access file hfspath with write permission -- # 'file' (typeFile) is OK in command parameter

or 'POSIX file' such as -

set posixpath to "/POSIX/path/to/new file"
set furl to posixpath as POSIX file -- # 'POSIX file' (typeFileURL) is OK
open for access furl with write permission


Hope this may help,
H

Message was edited by: Hiroto (fixed typo)
3 replies
Question marked as Best reply

May 19, 2010 6:20 AM in response to Mowri

Hello Mowri,

Well, I think that the 'file specication' problem is another story and is not the cause of error -10661 because kLSExecutableIncorrectFormat is to be thrown BEFORE the script is run.

---
As for 'file specification' (typeFSS), it has been deprecated under OSX.
Perhaps 10.6 has finished it.

Instead you can use 'POSIX file' (typeFileURL) or 'file' (typeFile) for both existing and non-existing file system object. And 'alias' (typeAlias) for existing file system object.
(Note that 'file' (typeFile) cannot be used by itself for some reason but only in conjunction with command.)

For example, if you're using 'file specification' for 'open for access' command such as -

set hfspath to "HFS:path:to:new file"
set fss to hfspath as file specification -- # 'file specification' (typeFSS) is deprecated
open for access fss with write permission

you may use 'file' such as -

set hfspath to "HFS:path:to:new file"
--set f to hfspath as file -- # you cannot do this for some reason
--set f to file hfspath -- # NG either
open for access file hfspath with write permission -- # 'file' (typeFile) is OK in command parameter

or 'POSIX file' such as -

set posixpath to "/POSIX/path/to/new file"
set furl to posixpath as POSIX file -- # 'POSIX file' (typeFileURL) is OK
open for access furl with write permission


Hope this may help,
H

Message was edited by: Hiroto (fixed typo)

May 18, 2010 5:49 AM in response to Mowri

Hello

Error -10661 = kLSExecutableIncorrectFormat

Defined in :
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Headers/LSInfo.h.

I don't know why it bites your app.

Take a look at the following thread, where the error was said to be caused by HFS Plus Case-sensitive format AND the usage of 'MacOs' intead of 'MacOS' in the executable's path.

http://www.cocoabuilder.com/archive/cocoa/239941-need-help-suggestions-with-weir d-problem.html

Good luck,
H

May 19, 2010 2:15 AM in response to Hiroto

Thanks Hiroto,

I have run the script instead of my App in snow leopard and found the following error:

Events Log:

error "Can’t make \"Macintosh:Folder:FileName.html\" into type file specification." number -1700 from "Macintosh:Folder:FileName.html" to *file specification*

I read somewhere that snow leopard deprecated _*file specification*_ is this the problem?

-Mowri

An error of type -10661 has occurred

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.