Login  •  Register


The time is now: Tue Oct 23, 2018 5:02 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 2 of 2 [ 36 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: 248
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: 248
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 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2221
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: 248
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 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2221
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: 248
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: 248
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 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2221
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  
PostPosted: Sat May 19, 2018 9:28 pm 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 248
After putting this on hold for a while I have continued working on it since yesterday.

In order to create a droplet, I have added some lines to the AppleScript that handles the binary conversion. I then copied the droplet onto the mounted volume shared by SheepShaver, just to realise it wouldn't work anymore. The only explanation I can come up with is the fact that afpfs-ng isn't able to handle/convert the date resulting in every file appearing as being created on 1 January 1970.

(At first I thought it might be due to security measures. But any other app copied to that volume can't be opened either, not even via "open" in the context menu.)

Is it possible that this prevents the applet from running? And is there a fix?
What I mean is: How to make OS X/macOS not care about the date or how to make it think 1970 is the correct date?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun May 20, 2018 4:05 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2221
Location: Emaculation.com
If the date is set to time 0, it's likely some of the filesystem metadata isn't being copied over correctly. This makes sense, as the bit fields changed between what was used in 7.6 and 8.6. I've gone through the macbinary documentation for macbinary 1 2 and 3, and they discuss some of this; it's probably relevant to apfs 2 and 3 as well.

The new versions are backwards compatible, as long as you check the fields correctly; it sounds like in this case the problem is assuming things in the other direction.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun May 20, 2018 9:07 pm 
Offline
Apple Corer

Joined: Wed Apr 10, 2013 9:32 am
Posts: 248
This is not related to the macbinary conversion. Even when I copy the droplet into SheepShaver using the Unix volume, and then move it into the folder I'm connected to from the host via AFP2, I have the same problem.

afpfs-ng-OSX creates a link in the sidebar that points to the folder "AFP2 Mounts" containing aliases of all mounted AFP2 volumes. That way volumes can be identified by their name (volume@server).
I'm using a work-around now making use of the above mentioned folder: After mounting a volume the droplet gets copied into "AFP2 Mounts" and renamed to "volume@server.app". That way it will be listed right under the corresponding mount alias and takes the files it then converts using macbinary and copies them onto the corresponding volume. Droplet and mount alias are deleted upon unmount.


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


Who is online

Users browsing this forum: No registered users and 4 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