• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: temporary items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: temporary items


  • Subject: Re: temporary items
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 29 Aug 2011 12:53:07 -0500

I have finally resolved this problem. My original copyFolder handler used the Finder's duplicate command to copy folders and files into my application bundle's /Contents/Resources/ folder. The duplicate command isn't very smart, requiring the handler to be recursive. This handler also contained the line ...

set destAlias to (folder itemName of contentsDest) as alias

which caused an error if the temporary items folder was not open in Lion. (I have filed this as bug id 10009144.)

To fix my script, I modified the copyFolder handler so that it is no longer recursive and, instead of the duplicate command, I used ...

repeat with sourceAlias in contentFolderList
tell application "Finder"
set folderName to (name of sourceAlias) as text
if not (exists folder folderName in contentsDest) then
set destAlias to make new folder at contentsDest with properties {name:folderName}
else
set destAlias to (folder folderName of contentsDest) as alias
end if
end tell
--
set sourcePath to (quoted form of (POSIX path of sourceAlias))
set destPath to (quoted form of (POSIX path of destAlias))
do shell script "ditto " & sourcePath & space & destPath
end repeat

The 'ditto' command is smart enough to know not to remove files and folders that already exist at the destination, hence no need for recursion.

My "Script Bundle Tool" is now working correctly in both Lion and previous systems. I will release version 4.3 soon.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >temporary items (From: Luther Fuller <email@hidden>)
 >Re: temporary items (From: Luther Fuller <email@hidden>)
 >Re: temporary items (From: Luther Fuller <email@hidden>)
 >Re: temporary items (From: Luther Fuller <email@hidden>)
 >Re: temporary items (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Missing value
  • Next by Date: alias or not an alias
  • Previous by thread: Re: temporary items
  • Next by thread: Re: temporary items
  • Index(es):
    • Date
    • Thread