• 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
Select folder, make new folder in same directory...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Select folder, make new folder in same directory...


  • Subject: Select folder, make new folder in same directory...
  • From: Inge Eidem <email@hidden>
  • Date: Mon, 11 Jan 2010 12:08:00 +0100

Hi again

There is so many bright heads in this list, and the help im getting is wery good. As im struggelig towards my applescriptgoal i hope you all can help me with the next section of the script.
I got help making a script for listing up all the files in a source folder to a text document, that tells me that my project is doable, but im not abel to get the rest done without your help.

So here is my project in discription.

"script"
1. Open dialog to select folder
2. Scan the selected folder for content (files/folder and subfolders + files)
3. make new folder ("selectedfoldername"-archive)
4. Put document with content of selectedfolder in "selectedfoldername"-archive folder
5. move selectedfolder to /Volume/mydisk/archived
---------------------------------------------------------------------
This script by Ed Stockly works like a charm creating the file, but the rest of the script is difficult for me to work out.

set myFolder to choose folder
set folderPath to POSIX path of myFolder
tell application "Finder"
    
set 
fileName to (the name of myFolder) & "-contents.txt"
    
set 
myContents to entire contents of myFolder as alias list
end tell
set
 
oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {folderPath}
set 
newList to {}
repeat with 
thisItem in myContents
   set thisPath to POSIX path of thisItem
   set the end of newList to text item 2 of thisPath
end repeat
set
 
oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return}
set 
myList to newList as text
set AppleScript's text item delimiters to oldDelims

set 
contentFile to (myFolder as text) & fileName
tell application "Finder"
    
set 
openFile to open for access file contentFile with write permission
   write myList to openFile
   close access openFile
   reveal item contentFile
end tell

Best regards
Inge Eidem

 _______________________________________________
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

  • Follow-Ups:
    • Re: Select folder, make new folder in same directory...
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: how?
  • Next by Date: AS, ASS, Cocoa, Call Method and memory troubles
  • Previous by thread: Re: Parsing out words in email subject
  • Next by thread: Re: Select folder, make new folder in same directory...
  • Index(es):
    • Date
    • Thread