Copying OS X apps

Ken Ray kray at sonsothunder.com
Tue Oct 29 17:57:01 EST 2002


Sorry about that...

I was saying you need to use applescript (and don't forget about use
colon-delimited paths). Here's the code I use... note that this works only
for the boot volume and not for other volumes (because non-boot volumes
start with "/Volumes/<volName>/"):


function CopyApp pSrcPath,pCopyName
  -- Assumes pSrcPath is "/" delimited
  put "" into tNewApp
  if last char of pSrcPath is "/" then delete last char of pSrcPath
  put pSrcPath into tASPath
  replace "/" with ":" in tASPath
  if first char of tASPath is ":" then delete first char of tASPath
  put "tell application" && q("Finder") & cr into tAS
  put "duplicate file" && q(tASPath) && \
    "of startup disk replacing existing items"  & cr after tAS
  put "set the name of the result to" && q(pCopyName) & \
    cr & "end tell" after tAS
  do tAS as AppleScript
end CopyApp

function q what
  return quote & what & quote
end q

Hope this helps... don't forget that if you copy an app in OS X, you still
will need to deal with bundle information, icons, etc. for the new copy.

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



----- Original Message -----
From: "Pierre Sahores" <psahores at easynet.fr>
To: <metacard at lists.runrev.com>
Sent: Tuesday, October 29, 2002 4:51 PM
Subject: Re: Copying OS X apps


> "J. Landman Gay" a écrit :
> >
> > Has anyone figured out how to copy a Mac OS X application? The usual
> > way, copying the data fork and the resource fork, doesn't seem to work.
> > Actually, they don't even have resource forks.
> >
> > The bundle structure seems to be the culprit. I tried copying each of
these:
> >
> > /test_app.app/Contents/Info.plist
> > /test_app.app/Contents/PkgInfo
> > /test_app.app/Contents/MacOS/MetaCardCarbonMach-O
> > /test_app.app/Contents/Resources/MetaCard.icns
> > /test_app.app/Contents/Resources/MetaCardCarbonMach-0.rsrc
> > /test_app.app/Contents/Resources/MetaCardDoc.icns
> >
> > But no go. I don't even get a folder structure. Any ideas?
> >
> > --
> > Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> > HyperActive Software           |     http://www.hyperactivesw.com
> >
> > _______________________________________________
> > metacard mailing list
> > metacard at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/metacard
>
> Hi Jacque,
>
> Did you try this in a terminal ?
>
> cp -R /theselectedpath/Ressources/ /thedestinationpath/Ressources/
>
> -R is the recursive option.
> --
> Cordialement, Pierre Sahores
>
> Inspection académique de Seine-Saint-Denis.
> Applications et bases de données WEB et VPN
> Qualifier et produire l'avantage compétitif
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>




More information about the metacard mailing list