Login  •  Register


The time is now: Fri Feb 23, 2018 10:09 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 2 of 2 [ 33 posts ]    Go to page Previous  1, 2
Print view Previous topic  |  Next topic
Author Message
PostPosted: Wed Feb 14, 2018 9:45 pm 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 219
In the meantime I had the same idea: Get rid of any non-ASCII characters. I have the script for that ready by now. For copying from macOS/OS X to Classic Mac OS many file names are too long and get truncated anyway. In that context, while being an international user, I don't see such a big issue in turning, e. g., 'ä' into 'a'.

Searching https://github.com/incbee/Unarchiver for "macroman" and "charset_macos" brought up some stuff. But I have no idea what to do with it. At that point I'm reminded that I am just a hacker :-)


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 16, 2018 11:12 pm 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 219
The script to copy a folder with subfolders and files onto a volume via afpfs-ng-OSX, amend the file/folder names where necessary and have macbinary encode the files is ready.
Now I'm attempting to script Mac OS 9 to have StuffIt Expander decode them again. The following line of script seems to be correct:
Code:
tell application "StuffIt Expander" to expand "file.bin"
But after having to wait for a moment I keep getting this error:
Quote:
StuffIt Expander got an error: AppleEvent timed out.

This is in both, Qemu running Mac OS 9.2.2 and SheepShaver running Mac OS 9.0.4.

Does anyone know what to do about this?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 16, 2018 11:42 pm 
Online
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1990
Location: Emaculation.com
Have you tried just telling "Stuffit Expander" to open file.bin instead of expand it? I seem to recall some versions of Expander's dictionary being a bit sketchy back in the day.

You could also try a different version of Expander to see if that helps.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 19, 2018 6:55 pm 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 219
None of that helps, I'm afraid. There's also a freeware tool called "MacBinary II", available at Macintosh Garden. But it's not scriptable. And
Code:
tell application "Finder" to open file "file.bin" using application "MacBinary II"
won't work either.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 19, 2018 7:06 pm 
Online
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1990
Location: Emaculation.com
Yeah; that was all added in later versions of AppleScript. :(

You could always either do it manually using http://files.stairways.com/other/macbin ... d-info.txt

Or, https://en.wikipedia.org/wiki/MacBinary lists some open source software at the end -- maybe we could create a tool to handle it all.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 19, 2018 9:58 pm 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 219
I have looked into the software in the wikipedia link already. Won't help, I'm afraid.
And doing it manually doesn't look like something I'm capable of.

Code:
tell application "Finder" to open "file.bin"
works for decoding with StuffIt Expander if I first set the file creator to "SIT!" using ResEdit. But I haven't succeeded in using AppleScript to set the file creator.

Any ideas on how to accomplish that or is that also a feature that has been implemented later?

EDIT:
Just found the fix: https://daringfireball.net/2004/02/scri ... ator_types
I used "file creator" as I found that somewhere else. But for the version of AppleScript that comes with OS 9.2.2 "creator type" appears to be correct.

EDIT 2:
I tried the above with the file creator of MacBinary III as license-wise it would be easier to ship that with afpfs-ng-OSX. The decoded file contains the resource fork, but first thing I saw was that it did not have the label it was given in OS X. If I use StuffIt Expander the label is preserved.

EDIT 3:
MacBinary III did decode with the correct label on second approach. Seems to be related to first rebuilding the desktop file.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 21, 2018 10:27 am 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 219
MacBinary III doesn't do the job reliably. Will have to use StuffIt Expander. The following works:
Code:
repeat with theItem in binList
tell application "StuffIt Expander" to expand file theItem
end repeat

However, I'd like to pass the files to Expander at once i.s.o. one by one in a loop. That should make things faster. According to Expander's AppleScript dictionary that should be possible:
Code:
expand alias  -- List of documents/folders/disks to Expand
But I could not yet find the correct syntax for that. What kind of delimiters do I use? Any other formatting I have to take into account?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 21, 2018 4:46 pm 
Online
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1990
Location: Emaculation.com
AppleScript accepts arrays of file aliases, so this is probably what you want. I can't recall the syntax offhand, but I know there's examples of its use in one of the online AppleScript repositories.

Meanwhile, this might be of use:
http://web.archive.org/web/200503070302 ... inary.html

I'm in the middle of a project of converting Apple Backup files to discrete MacBinary documents, but those docs also explain how to decode MacBinary and come with a Pascal and a C source code example. Might be more than you were planning for, and not necessarily needed if you're using Expander.


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 2 of 2 [ 33 posts ]    Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group