MACSCRPT Archives

December 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
john darnell <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 1 Dec 2008 17:04:06 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (112 lines)
Hello Mark:

   Unless there are some surprises waiting for me, I found that an
incredibly simple script looking like this did the job on a test file:

on run
	set file_info to choose file
	tell application "Finder"
		set file type of file_info to "AB65" --as text
		set creator type of file_info to "AD65" --as text

	end tell
end run

   At first I thought that this would not work for a file whose resource
fork did not exist, but the test files I ran this against had no
resource fork, and it worked fine for them.

   To determine if the file had no resource fork, I opened the file up
in Resourcer and noted that it displayed a string up near the top, "no
resource fork."

   I then ran the above script, selected the appropriate file in the
choose file dialog, and the rest was a cake walk.

   My intention is to make this a droplet, add a few lines to increase
robustness and then provide it to the users who need it.

   Please let me know if there *are* some surprises waiting.

R,
John

P.S. I just figured this out and was getting ready to send an email to
the list when I saw Mark's reply.  This was not a mean-spirited attempt
at an ambush.  I am *no* Mac script specialist. Mark Lively is and I
will be the first to admit it.


> -----Original Message-----
> From: Macintosh Scripting Systems
> [mailto:[log in to unmask]] On Behalf Of Mark Lively
> Sent: Monday, December 01, 2008 3:34 PM
> To: [log in to unmask]
> Subject: Re: help with resource forks...
> 
> If the resource fork is being removed there is no real way to recreate
> it (unless pagemaker does so)
> 
> There may be a configuration change that you can make to preserve the
> resource fork (many popular servers do so with auxiliary files/folders
> typically ._filename)
> 
> Baring that the best bet is to zip the file and then put it on the
> server
> 
> On Dec 1, 2008, at 4:07 PM, john darnell wrote:
> 
> > Hello all:
> >
> >   We recently switched to a new network service that has the
> > unfortunate side effect of moving the Pagemaker document data fork
to
> > the Mac client but not the resource fork.  This is particularly
> > unfortunate in that we build a report inside a Pagemaker document,
> > save
> > it on the network and then move it to the Mac client at a later date
> > for
> > use by editors.
> >
> >   The solution my bosses have come up with is to rewrite the program
> > generating the document so that the document comes out as a text
file
> > instead.
> >
> >   I would like to take a much simpler path and rebuild the resource
> > fork, ensuring that the appropriate creator and type values can be
> > found
> > therein.
> >
> >   Looking at 'resource' under man in the terminal, I do indeed find
a
> > command that will generate a resource fork if this syntax is used:
> >
> > Resource filename ?access?  //  Please note that the #@%!!%$#$#
email
> > client capitalizes the resource command-I use lower case
> >
> >   The 'man' description calls this a 'Tcl' command-Tool command
> > language.
> >
> >   Using this at the bash command prompt, I receive a 'command not
> > found.'
> >   I cannot find any further documentation as to how it may be used.
> >
> >   My questions are:
> >
> > 1.)	 Is there an easier way to recreate the resource fork of a
> > Pagemaker document with the requisite creator and type values?
> > 2.)	If not, how does one use the 'resource' command?
> > R,
> > John A.M. Darnell
> > Team Leader
> > Walsworth Publishing Company
> > Brookfield, MO
> > John may also be reached at [log in to unmask]
> >
> > Trivia Question:  In The Lord of the Rings, Gollum sometimes made
> > reference to his "birthday present," which he more often called 'My
> > Precious!"  To what was he referring?
> >

ATOM RSS1 RSS2