Create files & folders of 10 level depth Perform read rename delete move operations

How to do apple script for the below test
1. Create 10 level deep directories in smb share
2. List the root directory
3. Preform rename of the root directory
4. move the sub directories randomly
5. delete the 10 th level directory

I suspect there's more to your request than you're revealing here, but there are several ways to achieve what you want.
From a pure AppleScript perspective, you can create any folder hierarchy you like:
1. Create 10 level deep directories in smb share
tell application "Finder"
  set x to (path to desktop) -- change this to the path to your sharepoint
  repeat with folderName in {"a", "b", "c", "d", "e", "f", "g", "h"}
  set x to make new folder at x with properties {name:folderName}
  end repeat
end tell
2. List the root directory
This makes no sense without more context. What do you want to do with the results of this?
3. Preform rename of the root directory
You can rename any file/folder via something like:
tell application "Finder"
  set x to (folder "foo" of disk "sharepoint") -- get the folder - adjust as necessary
  set name of x to "bar" -- rename the folder
end tell
4. move the sub directories randomly
This makes no sense. Move them where?
5. delete the 10 th level directory
If this is all in one script, then my variable x from my original script will still hold a pointer to the most-recently created folder, so you can just:
  delete x

Similar Messages

  • I have a new ipad and want to create files for my documents I brought over from my Mac. How do I create file folders?

    I would like to create file folders for my documents I brought over to my ipad from my desktop Mac. I downloaded pages and neu.annotate. My files synced without a problem. PDF articles I put in neu.annotate and pages documents into pages but I would like to organize into folders like on my desktop. How can I do this on the ipad3?

    Unlike a 'normal' computer the iPad doesn't have a file system and everything on it has to be stored/associated within an app, you can't have separate folders of documents/files on your iPad's homescreens. If the apps that you have support it then you could possibly use Dropbox to store your documents within a folder structure, but you'd then need internet access in order to access them.

  • Too many files/folders in a directory poor performance

    We have an XServe running 10.6.2 with a large Fibre Channel Raid from ACNC. One of the shares is used for archive and has a lot of files/folders in it and as such takes a while to display and search. Is there any way to speed this up other than the obvious of not keeping so many in one directory? I am getting resistance to breaking it up into subfolders though that obviously is the best solution. What is the level at which performance degrades? Any documentation or info on this? Thanks!

    While all file systems support large numbers of files in a directory, any directory system performance degrades as the number of files increases. The actual number may vary from file system to file system (e.g. UFS, HFS+, NTFS, EXT2/3/4... the list goes on) but it's always there.
    In pure technical terms, the performance starts to degrade on single-digit (typically 4 - 10) number of files since past that the directory index exceeds a single block on disk but the difference between reading one block and two isn't noticeable to the average human. In practical terms, on most direct-attached storage you'll see a performance drop at around 10,000 files. By 20,000 it's noticeable.
    These numbers can be far worse over a network connection since it has to be read by the server before it can be passed over the network and re-parsed by the client.
    There isn't much of an option other than to strip the directories down.

  • Newly-created Files & Folders Permission Problem

    Hello. I have a Snow Leopard Server 10.6.8 with Snow Leopard and Lion clients.
    When all Macs were running Snow Leopard, any client could create new folders and files on the Snow Leopard Server, and all other Mac clients can access and modify them (Read and Write permission).
    I updated a few clients to Lion, and now when a Lion client created a new file or folder on the Snow Leopard Server, only that client has Read & Write permission. All other client now cannot modify the newly-created file/folder.
    My temporary fix is to change the folder or file permission on the server so everyone can have access.
    Does anyone know how to fix this? Is this the Lion client problem or the Snow Leopard Server problem?
    Thanks.
    Alex.

    Hello. I have a Snow Leopard Server 10.6.8 with Snow Leopard and Lion clients.
    When all Macs were running Snow Leopard, any client could create new folders and files on the Snow Leopard Server, and all other Mac clients can access and modify them (Read and Write permission).
    I updated a few clients to Lion, and now when a Lion client created a new file or folder on the Snow Leopard Server, only that client has Read & Write permission. All other client now cannot modify the newly-created file/folder.
    My temporary fix is to change the folder or file permission on the server so everyone can have access.
    Does anyone know how to fix this? Is this the Lion client problem or the Snow Leopard Server problem?
    Thanks.
    Alex.

  • Creating file folders in iPad mail

    Is it possible to create mail folders in iPad mail, or is there an app that let's you organize mail into folders

    It depends on what email provider your using to make a new folder. For example I use gmail and coustum folders in gmail are called labels. Don't ask me why they are called labels... You can add a folder from the iPad and here is how to do it with gmail.
    Open a new browser window in Safari...
    Type in google.com in the URL address bar...
    Click on Gmail in the menu...
    Type in your user name and password...
    When Gmail loads, look at the bottom of the page and click on basic HTML...
    You can add folder (labels) in two places. From the settings (top right), label tab. Or from the  left hand column, labels, edit labels...
    Add the a new label with a name...
    You can add as many folders (labels) to you liking.
    Click on the email icon app. If the new folder doesn't show up hit the home button and click on the email app again, the new folder should show up.
    Once you have done this a few times you'll get a good workflow.
    I'm sure you can do this with other email providers that let's you access your email by way of a bowser page.

  • [solved] Thunar doesn't respect umask when creating files/folders

    Having this permissions:
    $ umask
    0007
    When creating files / dirs in a terminal the new ones will get the correct permissions. However when doing the same in Thunar (checked with pcmanfm, too) the files / dirs get different permissions:
    -rw-rw---- 1 nap users 0 Jun 30 16:31 new2 - cli
    -rw-r--r-- 1 nap users 0 Jun 30 16:31 New Empty File - thunar
    drwxrwx--- 2 nap users 4,0K Jun 30 16:32 dir-cli
    drwxr-xr-x 2 nap users 4,0K Jun 30 16:32 dir-thunar
    Shouldn't applications respect the user's umask settings? Is it a bug or a feature?
    Last edited by siriusb (2012-07-01 10:12:23)

    Thanks, very useful link.
    Now I understand why it works this way. However I'm wondering whether putting umask to ~/.xprofile would work.
    Or in .xinitrc before the line that starts WM. I'll try.
    Update:
    Gcool thanks again.
    Putting umask into xprofile works exactly as I need it to work!
    Last edited by siriusb (2012-07-01 10:12:04)

  • How to stop Windows iTunes from spontaneously creating new folders with duplicate copies of songs, and renaming existing folders?

    I've recently started using iTunes regularly to import CDs. Since then, I've found my Windows 'My Music' folder is behaving in bizarre ways.
    I like to organise most of my music in folders by Genre --> Album title, without paying attention to Artist. I also like to rename certain album folders (and the Album name in each track's metadata as well, so that each album/folder remains consistent), and also to create customised 'mix tape' album folders. I just want to use Windows Explorer / My Computer to manage this; I don't want to do it via iTunes. I just want to use iTunes for initially getting the music from CD to computer.
    Previously, when I was using Windows Media Player to import CDs, if Windows Media Player placed an imported CD under a folder category I don't use, such as Artist, I would just manually move the Album folder and delete the empty parent Artist folder. However these days iTunes is spontaneously creating an entire series of Artist folders, even for tracks and albums that were already on my computer, and is placing duplicate track files into them. Additionally, it's renaming albums for folders and tracks I've customised, turning album titles back into their original values. This is happening even though the destination for newly imported/downloaded iTunes tracks is not the My Music folder itself, but rather another folder within that one. I've had a look at Preferences --> Advanced and the 'Keep iTunes media folder organised' and 'Copy files to iTunes Media folder when adding to library' boxes are already unchecked, so it's not related to that anyway. How do I get iTunes to leave my folders alone?

    First off see this user tip so should any further unwanted changes happen you have a chance to revert to your original layout.
    It is not unknown for AV software to interfere with iTunes and corrupt its configuration files. If this happens iTunes can revert to the default settings to "Keep..." & "Copy...". Deselecting those options won't return any files to their original paths.
    If you have "Show iTunes in the Cloud Purchases" enabled under Edit > Preferences > Store that can lead iTunes to download the original metadata for any of your purchases and show that instead of any edits you may have made to it. Turing that option off and restarting iTunes may reveal your version of the metadata.
    There is another option under Edit > Preferences > Store that reads "Share details about your library with Apple" although I don't think that changes metadata in the way that the similar option in Windows Media Player does. Double-check your settings in Windows Media Player (Options > Library) to make sure it isn't set to "Retrieve additional information from the Internet". This is usually the cause of spontaneous tag resetting. WMP can be called into life in the background when visiting certain websites and it has a lazy cache, meaning it can sometimes write out metadata to your media files long after the data was originally acquired.
    It is also work noting that mp3 files may contain multiple tags and iTunes, for one, treats these unpredictably. In some cases it may appear to accept and write out a tag change only to later read back the original unchanged data from another copy of the tag.
    tt2

  • Creating file with 2 pdf pages on Adobe Reader XI vers 11.0.07

    2 pdf files.  Can I create one file containing both?

    No way with just the free Reader. You need Acrobat, or one of the online services, to do that.

  • The file folders I created in my Inbox have disapeared, how can I retrieve these emails?

    I'm a new user of thunderbird. I used to label my emails, but was finding it hard to find them again, so I decided to create file folders in my inbox, I created 4 and now I only have 1 of those. Now I can't find those emails, and even searching for the labels, I can't find them in my inbox. Can I retreive those emails?
    Thanks!!

    Thanks for the information. Is there any way to undo what I did and be able to see the mails that were in those folders in my inbox? Also, in the link I didn't see how to create these other folders you mention. If I try to crate a folder it asks me if I want them in the inbox or local folders.
    thanks again.

  • How do I add files/folders  from school to my Dropbox on iPad

    I've emailed downloaded lectures for school to myself...Dropbox says I can create files/ folders and I am at a loss as to how to do this. I want to save all lectures/ material to my iPad and move them to Dropbox...I have win zip and iCab too...just don't have the knowledge to use them

    With Dropbox installed, Go to the mail that you received, click and hold on the attachement and you will receive an Open in ... dialog, select Dropbox or folder in dropbox.
    Go to Dropbox App and verify.

  • Help needed in recovering files/folders after using xfs_repair

    So it started out with whammy! Some files were not playing (audio) which previously they were doing fine without any issue !
    So I thought of changing the permission and got many errors regarding abnormal inodes and since I was using  XFS filesystem I tried fixing the issue by using xfs_repair
    Now the catch is that during the repair xfs_repair wizard deleted many folders and stated a message that "moving to lost+found"
    The issue is I am not able to locate any folders in /lost+found and whats intriguing is that most of the inodes and links to the folders (deleted/moved) are still visible with ls -l
    Please find the dump of the commands
    1. chwon and xfs_repair - http://bpaste.net/show/173394/
    2. ls -l - http://bpaste.net/show/173401/
    Is there any way I can fix the partition and recover the file/folders that have been missing/moved and/or deleted?
    Some help will be appreciated
    regards

    Can anyone please shed some light on the recovery portion!
    Thanks

  • Asking to delete icons/files/folders to recyclebin when I left clicked any icons/files/folders

    When icons/files/folders are clicked they are asked to be deleted. A pop up window appears multiple times showing delete file.Formated the OS but didn't worked. I have only one temporay solution "Simply refresh and click enter twice".I need a permanent solution.

    Managed to solve this myself. Just went to properties > hidden.

  • Importing Frame files without creating RH folders

    Hiya.
    I'm importing Frame 7 files into RH 7. When I import the files, RoboHelp creates folders for each chapter in the Frame book. When I reimport, it creates MORE folders and nests the older folders in them. How do I turn this off? I want to import the files without structuring them in folders.
    Thanks.
    KC

    MP_Root (at the root level of the card directory structure) and putting a folder 101PNV01 inside the MP_Root folder. I then put some mpg-2 file in the 101PNV01 folder, started iMovie '08, inserted the flash card and had the files recognized so I could import them.
    Great. This works!
    Here is what I did (and this should work for anyone who has old .MOD files but no longer has the accompanying .MOI files):
    Like F Shippey stated
    1) Create a root folder on your sd card (in my case, via a USB card reader) or USB stick (not tested) called Mp_Root.
    2) Inside this folder create another folder called 101PNV01.
    3) Rename the extensions of all your .MOD files to .MPG and copy them inside the 101PNV01 folder.
    4) Restart iMovie08. It will now detect a new camera and import all clips using the date created/modified info as timestamps for perfect cataloging!
    iMovie 08 does NOT re-encode the movie files, which is great cos it's very quick plus you retain 100% the original quality. It simply puts them in a .MOV container and creates a separate movie file for the thumbnails.
    Thanks for your help F Shippey!

  • When saving a File OS Is Creating Multiple Folders With The Same File Name

    Not sure what I changed but, now when I save a any file (ppt. word, Keynote,Pages e.g.,) to the desktop or any other location the OS will also create multiple file folders with the same file name as the file I'm saving. Inside the folders are what appears to be files locating the saved files. What can I do to fix this problem?
    I'm using the 10.7.2 version
    MacBook Pro

    Misio wrote:
    It looks like a finder bug. To replicate, I surf to any website, I right-click on a jpg image, select "Save Image As" and in the window that pops up I type in the filename "000.jpg", I select the folder Pictures, and click on Save.
    BTW, I don't know why, but the file was saved only as "000" without the file extension ".jpg". Does anybody know why?
    the extension is simply hidden. go to the get info panel for the file and uncheck the option to hide the extension.
    Then I surf to another image, and again I save it as "000.jpg" and now it asks me if I want to replace the existing filename, although the existing one is "000" and I try to save as "000.jpg", so I say yes, and then magically the file is saved with the full filename including the extension "000.jpg"
    When I did it a couple of times, always saving image as "000.jpg" from various sources, I ended up with two distinct files named "000" and both in the same folder Pictures.
    Please advise.
    it sounds to me like you saved one file as 000.jpg and the other and 000.jpg.jpg.
    check the info panels for the files for full names to verify if this is the case.

  • Organizing Files is moving all folders up one level???

    I noticed just recently that when I use the Automatically Add To iTunes folder that Artist folder was being created at the top level of the Library folder, rather than under Music. I tried checking and unchecking Pref for Organzing to no vail. iTunes now insists on moving or creating Artist at the same level in the folder hirarchy as Music. Also noticing this with Books, etc. Library Path hasn't changed. What gives????
    I also note that the option to File>Liobrary>Reorganize files in the folder "Media" has reappeared. It used to be grayed out. So, I checked that and Consolidate and hoping it will get straightened out.
    I have a large library with ~50K songs, so this thrashing my NAS is annoying.

    iWeb publishes your website files in a folder with the name of your website. If this folder is uploaded to the root folder on your server you will get the double barreled URL.
    The answer is to publish your site to a local folder and upload the contents of the folder with an FTP application - not the folder itself.

Maybe you are looking for