Adding files to encrypted disk images

Here's what I'd like to do:
- Select a file or folder "foo" with Finder
- Go to my AppleScript menu bar item and choose a script to do the following:
1) Mount an encrypted disk image (I already have one made); the password is not in my keychain so I'll need to be prompted to enter it
2) Copy "foo" to the top level of the mounted disk image
3) Unmount the disk image
4) Move the original file to the trash
5) Secure empty the trash
I don't speak AppleScript very well; can anyone help?

Thanks, Niel. You are always so helpful.
I couldn't get it to work, though. The disk image wouldn't mount with the "open file" command. So I changed the first line to:
do shell script "hdiutil mount ~/Documents/Miscellaneous/files.sparsebundle"
That works; it prompts me for the image password and then mounts the image. So far so good.
But then it stops with this error message:
Can’t make {} into type alias.
Do you know how to fix it?

Similar Messages

  • Corrupted files within encrypted disk images

    Greetings Apple Hivemind:
    I've run across a repeatable problem when using encrypted disk images from Disk Utility.  Essentially, I'll create an image using settings like are shown below:
    The disk image is then used for storing data.  In my case, this is usually data for Adobe Lightroom.
    At first, this worked very well, and I housed the disk images on my household NAS, connecting via samba (smb) to it on my Mac.  Over time, however, something odd started happening:  Files on those encrypted images began getting corrupted whenever I tried writing new data to them.
    My first incident was where Lightroom informed me that the catalog it was trying to open was corrupted.  I  tried to create a new one on the same encrypted volume, and it too was instantly flagged as corrupted.  I opened the individual image files on the volume with no problem, so I wasn't thinking that the volume was the culprit.  That is, until I tried dragging new image files to it manually.  The new files were immediately either completely unreadable, or a mish-mash of the content of random OTHER files on the volume!
    The result was that all old data seemed intact, but I could no longer write new data to the volumes without major data corruption issues.  I thought that this was isolated to one volume in particular, but it soon started happening on ALL of my encrypted volumes eventually.  Including those which were not, and never had been, housed on my NAS, but were on my local hard drives.
    I've since "evacuated" all my data from these images, since the ones created by Disk Utility appear to be useless, and am seeking an alternative.
    Is this something that anyone else has encountered when using encrypted disk images?  It seems like this is something I should really open a support ticket for, but I can't say I've ever tried it, so I don't know how successful it would be to do so.

    bbonn wrote:
    I should add that I've tried using the "Repair" and "Verify" functions of Disk Utility on the volumes, and despite the obvious issues that exist in them, the utility doesn't find (or fix) any inconsistencies.
    Are you repairing/verifying the actual disk images, or just the partition they're on?  If the partition, it won't look inside them.
    Drag one to Disk Utility's sidebar, select it, then use Verify or Repair.  Note: the usual messages may not appear on the DU window.  Click the Log icon in the toolbar or select Window > Show Log from the menubar to see them.

  • My Automator script to backup files to encrypted disk image

    Hi there. I have a question regarding Automator and Encrypted disk images. I've put together a workflow that grabs files in my home folder. My home folder is utilizing FileVault. I'm grabbing things like my iphoto library, documents folder and such. On an external usb drive I've created an encrypted disk image about 100GB. My goal is for the automator action to "successfully" mount > copy > unmount the encrypted image.
    As of right now, the script works, but gives an error at the end of the copy, not allowing a successful unmount of the dmg. Is there something I'm doing wrong? I browsed through all the files after copying and they are all there, the folder sizes match up 100%.
    I guess I could just use a program that does this, but, I find it much easier clicking on a shortcut in my dock to run the script and go away for 10 - 15 mins.
    If it would help to view the script, let me know and we'll work something out.
    Thanks

    The popup box says:
    The action "Copy Finder Items" encountered an error. Check the action's properties and try running the workflow again.
    And the Automator workflow log says:
    Can't read directory contents: /Volumes/Backup
    But as I said, clearly it works and reads/writes to the encrypted dmg because all the files are there. What I do is just select all the folders inside the drive first, and delete/empty the trash first before running the action. This is the second step once I know this is working. So that I don't have to manually delete them everytime before running the script.
    So to answer your question, the drive is empty, and the dmg is empty, allowable for a maximum 100GB of storage.
    I think it might be something to do with copying files to an encrypted disk image, but, I can't find any help anywhere on this.
    Thanks

  • Alias to open a file in an encrypted disk image

    Deleted.

    There is a quick and simple test, could someone with Lion installed be so kind as to do this:
    1. Use Disk Utility (or Knox if they own the app) to create an encrypted disk image on the Desktop called Test
    2. Mount the image, open TextEdit and paste a page of text into the window, then save the file in the mounted disk image
    3. Paste another page of text into the TextEdit window
    Open Terminal, navigate to /Volumes/Test, view the hidden files in the directory & post the results here.
    All you need to do to clean up is eject the disk image then drag the .sparsebundle file to the Trash.
    Cheers

  • How does one save new files to an encrypted disk image?

    I encrypted a particular folder, and used a sparse image to leave plenty of room, as well as using read/write permissions, but I don't see how to save new files to the encrypted folder.

    So, I guess you have to save the file to the desktop and then drag it to the mounted disk?
    No, you should be able to save directly to a mounted disk image via a dialogue box. There is no need for an intermediate step. As long as the encrypted disk image is mounted, it is open and appears to be just another folder.
    As an experiment, open a Textedit document and save it to the mounted (open) disk image via Save As in Textedit. It should be able to do that.

  • File Vault on HOme Directory with encrypted disk image in it

    I want to try File Vault. My question is as follows: I have an encrypted disk image already in my home folder. It is a small 500 MB one. Can I keep that in there, as is, without problems, or is File Vault going to encrypt and encrypted image and cause some sort of problem?
    Has anyone done this without issues?
    I know the alternative is to unencrypt my current image and let File Vault handle the encryption, but I am curious about leaving it alone and trying File Vault.
    Thanks for any help,
    x-.-x

    x-.-x wrote:
    I want to try File Vault.
    Good luck!
    File Vault going to encrypt and encrypted image and cause some sort of problem?
    FileVault is no more likely to scramble an encrypted disk image than it is to scramble the rest of your files. However, it is quite likely that it will scramble all of your files.
    Has anyone done this without issues?
    I have read many postings here in the discussion forums by people who have used FileVault and lost all of their data. Your mileage may vary. The only way I would use FileVault would be if I had an unencrypted copy of everything somewhere safe. Like you, I keep a small encrypted disk image for particularly sensitive files.

  • Encrypted Disk Image creation slow?

    I just got a new MBP with Leopard. I have created a number of encrypted disk images in the past using Tiger and a MBP and have not had any trouble. This weekend I tried a few times to create a 50 gig encrypted disk image (128 AES) on an external drive and after going through the process of setting it up and waiting for it to be created, (and watching the progress bar as it was being created), after about 45 minutes NO progress was showing on the progress bar. I ended up having to cancel the creation a few times because I thought something was going wrong. I’m not sure if there is a problem creating the disk image, or leopard is slow, or what.
    Does anyone know how long, on average, it would take to create an encrypted disk image of this size using leopard? I just want to know if there is a problem doing this on my MBP. Thanks for the help.

    A regular 50 GB disk image takes 50GB of space, no matter if it is full of files or empty.
    A 50 GB sparse disk image only takes up the amount of space equivalent to that of its enclosed files. So if the 50GB sparse image only has 1 GB of files inside, the image won't be much bigger than 1GB.
    A sparse bundle is similar to a sparse image, but instead of a single file it is a folder package with many, many enclosed files called bands. A new file added to the sparse bundle will tend to modify only a few bands. This makes incremental backups of a sparse bundle more efficient because only the changed bands need to be backed up again. Any change to a sparse or regular disk image will mean that the entire image will need to be backed up again.
    If you regularly add/remove files to a disk image, and you intend to back up that disk image with Time Machine, a sparse bundle is definitely the way to go. The other types will fill up your TM volume very quickly.

  • Encrypted disk image creation very slow-

    I just got a new MBP with Leopard. I have created a number of encrypted disk images in the past using Tiger and a MBP and have not had any trouble. This weekend I tried a few times to create a 50 gig encrypted disk image (128 AES) on an external drive and after going through the process of setting it up and waiting for it to be created, (and watching the progress bar as it was being created), after about 45 minutes NO progress was showing on the progress bar. I ended up having to cancel the creation a few times because I thought something was going wrong. I’m not sure if there is a problem creating the disk image, or leopard is slow, or what.
    Does anyone know how long, on average, it would take to create an encrypted disk image of this size using leopard? I just want to know if there is a problem doing this on my MBP. Thanks for the help.

    A regular 50 GB disk image takes 50GB of space, no matter if it is full of files or empty.
    A 50 GB sparse disk image only takes up the amount of space equivalent to that of its enclosed files. So if the 50GB sparse image only has 1 GB of files inside, the image won't be much bigger than 1GB.
    A sparse bundle is similar to a sparse image, but instead of a single file it is a folder package with many, many enclosed files called bands. A new file added to the sparse bundle will tend to modify only a few bands. This makes incremental backups of a sparse bundle more efficient because only the changed bands need to be backed up again. Any change to a sparse or regular disk image will mean that the entire image will need to be backed up again.
    If you regularly add/remove files to a disk image, and you intend to back up that disk image with Time Machine, a sparse bundle is definitely the way to go. The other types will fill up your TM volume very quickly.

  • Unable to create an encrypted disk image in Lion

    disk utility gives the error Unable to create "Volume.dmg." (error - 60008) when creating an encrypted disk image. I am using the following steps:
        1.    Open disk utility
        2.    Select the disk (internal or external) to create the image on
        3.    Select File>New>Blank Disk Image…
        4.    Save As: 'Volume'
        5.    Name: Volume
        6.    Size: 50GB
        7.    Format: Mac OS Extended (Journaled)
        8.    Encryption: 128-bit AES encryption
        9.    Image Format: read/write disk image
        10.    Click the Create button
        11.    Password dialog appears
        12.    When I enter a password the dialog closes after entering only a few characters i.e. before I've finished typing, and the following error message displays:
    Unable to create "Volume.dmg." (error - 60008)
    I have previously, successfully, created encrypted disk images in Snow Leopard, and I don't know why I can't in Lion
    Does anyone have any ideas?

    Thanks for this Thomas.
    I've tried naming the image differently, but still received the error, I did however try different permutations for the password.
    The error seems to happen if I use a purely numerical password string and occurs on input of the 10th numerical character, if I start with numerical character but use an alpha before the 9th number I can continue and create a password, and I can create a password  if I start with an alpha and switch to numerals after the first alpha character, purely alphabetical passwords are fine too.
    It seems that Lion doesn't like purely numerical passwords greater than 9 characters, whereas Snow Leopard wasn't so fussy. Seems it's a bit of a bug.
    Thanks for your help

  • Encrypted disk image on external drive prevents that drive from ejecting

    I've tested this a few different ways, and it seems to be a rather consistent problem.
    I have an external USB hard drive (seagate) and on that drive I use encrypted disk images to store my data.
    (because it's a portable drive, I'm nervous I'll lose it and then someone will have access to my stuff).
    So anyway, whenever I mount the sparse bundle disk image, when it comes time to eject the drive (after ejecting the disk image of course), it hangs for a while and then the Finder says it can't eject, but that I can Force Eject the drive.  When I chose to Force Eject, it works, but I don't like having to force it every time.
    Anyone know what's up?
    Thanks,
    Brian.,

    Open Disk Utility > File > New >Blank Disk Image...
    or use the "Option-⌘-N" Key combo (with Disk Utlity open).
    Kj

  • Create encrypted disk image with OS install disk utility.

    I thought to make a full backup of Macintosh HD, and followed instructions in /kb/ht1553.  However, every time I tried to creae an encrypted disk image, it barfed with "Failed - User interaction required". I assume it needed the encryption password, but for some reason was unable to display a prompt for this. Anyone know how to fix this?  Thanks, Stephen.

    Create an encrypted sparse disk image instead of from folder, mount it, and then drag & drop your files into ii.

  • Creating an Encrypted Disk Image on an External (USB) Drive

    I have an external 600 GB drive (2x 300 GB SATA 3.5" disks in a Thecus N2050 RAID0 external enclosure connected to iMac by USB2) onto which I would like to backup a large amount of data (500 GB).
    I store this external drive away from my home (in the office) and since I cannot guarantee physically locking away the drive I would like to logically lock the drive by placing all the backup data into an encrypted disk image created on that volume.
    I have tried creating an encrypted disk image on my USB volume in Disk Utility (Apple's instructions here) but I experience a number of issues not documented in the Apple article:
    1) I am not presented with a drop-down option for the size of the disk image.
    2) When I go ahead and try to creat the image I am told that the creation was impossible "file or folder does not exist".
    Is it possible to create disk images on USB volumes (I cannot create such a large disk image on my iMac HDD as I do not have sufficient space).
    thanks in advance
    Raf

    I realised that in Disk Utility you must not have any of your mounted drives highlighted in the left hand pane.

  • Indexing of encrypted disk images permanently disabled in 10.8?

    In the past, I've had no trouble forcing Spotlight to index my encrypted disk image, using the command in Terminal:
    sudo mdutil -i on /Volumes/Encrypted_Data
    After entering that command, my encrypted disk image was indexed and searchable using Spotlight.
    A couple weeks ago I updated from Lion to Mountain Lion. Today I noticed Spotlight wasn't showing any results from my encrypted disk image. So went back to Terminal and entered the above command. Instead of successfully activating indexing, Terminal gives me this message:
    /Volumes/Encrypted_Data:
                Indexing disabled.
    Is this procedure now impossible in Mountain Lion?
    Is there any way to enable indexing of this encrypted disk image? I can't get it to work.
    Thanks.

    I appear to have solved the problem to get Spotlight to index a disk image.  My image was an encrypted disk image.  I was able to get spotlight to work when it was new, but now Spotlight won't index it.  Here is the solution that I found:
    After double clicking and mounting disk the image, open Disk Utility, select the disk image file, then click unmount in the Toolbar.  Wait until it is unmounted, then click mount again.   Then go to terminal and try mdutil -sa .  If it is still not enabled, try to sudo mdutil -i on option.  The unmounting and remounting must be done everytime the image is opened.

  • HT1578 Labels (Mavericks) not working in encrypted disk image?

    I created an encrypted disk image with Disk Utility.
    I placed a file in the opened encrypted disk image, and labeled it with "test".
    If I open a finder window and look for files labelled "test" the file doesn't appear.
    This message is placed under the wrong OS, because it is not possible to choose Mevericks from the popup list!!!!

    Where I used the word label I did mean tag

  • Even though I have LCD font smoothing disabled, Mountain Lion still uses it in PDF views, Safari's location bar, Mail's message view, and the dialogs for mounting encrypted disk images.

    Even though I have LCD font smoothing disabled, Mountain Lion still uses it in PDF views, Safari’s location bar, Mail’s message view, and the dialogs for mounting encrypted disk images. Is there any solution to this problem? Also diabled the Smoothing in the SystemPrefs and also via Terminal. Font smoothing is still there. Very annoying, especially in PDF attachments in Apple Mail.

    Try feeding Safari a user-defined CSS file with font-smoothing tweaks (including none). The filename and its filesystem location are arbitrary. Use your favorite coding editor.
    Safari > Preferences > Advanced > Style Sheet:
    Here is an example with all elements uncommented. Pick the one that works best for your Safari viewing and comment out the others:
    Preview. Try Preview > Preferences > PDF > Smooth text and line art (uncheck)

Maybe you are looking for