Error 57 opening file from Finder

Using Standalone Maker to build executables or delivering projects for use with the SuperCard Player? Discuss it here.

Error 57 opening file from Finder

Postby KevinPaszalek » Sat Jun 08, 2013 2:13 am

Greetings!
I have created a standalone which creates its own kind of files with their own file type for storing data. When I double click on these files in the Finder, I am greeted with a Error 57 Wrong File Type error notice.
The file type is set when creating the file using the setFileInfo XFcn.
The Finder recognizes that it is associate with my program because it has the correct custom file icon and the Finder opens my standalone when the file is double clicked on.
I have no idea what goes on under the hood in SC under these circumstances. I can't get the code which I cut and pasted from SuperCard help for errorObject and errorOffset to work at all (SuperCard can't understand the arguments!!), so I don't even know what's throwing the error.
I just don't know enough to know where to look next.
Any suggestions, anyone?
Thanks VERY much.
Kevin
KevinPaszalek
 
Posts: 105
Joined: Fri Jun 08, 2012 11:35 am

Re: Error 57 opening file from Finder

Postby KevinPaszalek » Mon Jun 10, 2013 12:25 pm

Anybody? I don't even know where to start looking!
Thanks in advance,
Kevin
KevinPaszalek
 
Posts: 105
Joined: Fri Jun 08, 2012 11:35 am

Re: Error 57 opening file from Finder

Postby codegreen » Mon Jun 10, 2013 1:41 pm

ErrorObject and errorOffset are only valid when script editing is enabled.

If you define a custom file type owned by your standalone, you're responsible for writing code to handle opening (and printing) it. You do that by adding an appleEvent handler to your project, and intercepting the 'odoc' (open document) and 'pdoc' (print document) events. There's an appleEvent handler in the scripts for the RTE's recent items menu in the sharedFile you can scarf the skeleton from (press Control-S and search for 'appleEvent').

Without this the event will fall through to SuperCard, which will then try to interpret your file as a SuperCard project. If it isn't a valid project, you'll get a wrong file type error.

-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm

Re: Error 57 opening file from Finder

Postby KevinPaszalek » Tue Jun 11, 2013 12:45 pm

Thanks, Mark. I appreciate the tip.
I located the script, and now I'm working through integrating it.
Blessings,
K
KevinPaszalek
 
Posts: 105
Joined: Fri Jun 08, 2012 11:35 am


Return to Building Standalones

Who is online

Users browsing this forum: No registered users and 1 guest

cron