Encrypted Disk Images and ApplescriptObjc

Hi all!
Im a bit of an applescript newb but i can find my way around most things. Ive been working on an applescriptobjc project in the new xcode 3.2 in snow leopard and I cant for the life of me get it to mount an encrypted .dmg file.
My script is as follows:
on mountButton_(sender)
set filePath to (POSIX path of (choose file with prompt "Select a file to use" of type {"DMG"}))
tell current application to do shell script ("hdiutil mount \"" & ¬
POSIX path of (filePath as string) & "\"")
end mountButton_
This works for non encrypted files but not encrypted ones. The weird thing is this script works perfectly fine in applescript editor but not in my Xcode compiled project.
Anyone have any ideas?
Cheers

Solved it!! Through sheer serendipity I stumbled across the solution!
Turns out the shell script needed an & on the end. No idea why.
ie.
tell current application to do shell script ("hdiutil mount \"" & ¬
POSIX path of (filePath as string) & "\"&")
Im not all that familiar with shell scripts. Is there anyone who can tell me what I've actually done by including the & on the end? Just for future reference.
Cheers

Similar Messages

  • Encrypted Disk Image and Backup

    If one uses Apple’s Disk Utility to create an encrypted disk image, what happens when SuperDuper, Time Machine, or any other backup utility is running while the (unencrypted) image is mounted on the desktop?
    Are both the encrypted image and the unencrypted data transferred to the backup device? Or is just the secure encrypted data copied to the destination?
    Nothing urgent on this, just curious. Thank you!

    I've played around with this a little. As best I can tell, when cloning an entire HD volume both CCC and SuperDuper will always copy an image file (.dmg, .sparsebundle, etc) that resides that on that HD, whether or not that file's disk image is mounted at the time. However the contents of the mounted disk image volume will not be copied separately, and so If the disk image is encrypted, no unencrypted content will get transferred this way. However as mentioned in the SuperDuper link above, it's better to unmount the image in any event, in order to ensure that the underlying .dmg or .sparsebundle file gets copied faithfully.
    If you want to copy the contents of a mounted disk image with CCC or SuperDuper, you can do so as a completely separate procedure from copying the HD. If you first mount the image (giving a password if it was encrypted), that mounted image will appear as an independent volume in the "source list" of CCC or SuperDuper, and you can choose that volume as a source for the copy procedure. You would need to designate a different target volume as well, so as not to overwrite your HD clone. If the disk image was encrypted and you deliberately copy its mounted image separately in this fashion, the resulting files on the target will not be encrypted.

  • 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

  • Removing an encrypted disk image

    A while ago, I created a 7gb encrypted read/write disk image and put some files in it. Now, recently, I removed the files in the encrypted disk image and copied them back into the regular HD. I erased the mounted disk image and now says it's back to 7gb.
    How do I remove the disk image? It's still there in my documents folder. How do I melt it back into the HD space? I can remove it from the side bar on the disk utility page but it's still on my HD and I can still mount it to the finder. I enter my password and it mounts.
    I want to get rid of that disk partition as I don't use it anymore. What do I do? Is it there forever and am I stuck with it?
    Thanks in advance for anybody that can help me with this.

    Niel,
    You know I actually tried that before but the trash was hanging and hanging. I have it set to empty securely and I know it takes longer for secure empty but it was really long.
    I'll try it again but is that normal? Does the encryption have anything to do with it?
    Thanks for the help, hope this time it works.

  • Encrypted disk image mounting

    I'm trying to find a way to make an AppleScript that will mount an encrypted disk image and enter the password for it automatically. I can make it open all right, but I can't figure out how to make it enter the password (the 'with password' command doesn't seem to work, I'm assuming it only works on remote volumes?).
    Any help would be appreciated.

    Something like this should work:
    <pre>
    set myResult to display dialog "Enter password:" default answer "" with hidden answer
    set thePW to text returned of myResult
    set cmd to "echo -n \"" & thePW & "\" | hdiutil attach /path/to/encrypted/disk/image.dmg -stdinpass"
    do shell script cmd
    </pre>
    There are some security concerns with passing a command string to "do shell script" that contains your password. If other users log on to your machine they could see your password if they happened to be watching the process list at just the right time.
    Steve

  • Encrypted disk image from ****

    So i made an encrypted disk image and forgot the password.
    The disk image:
    Size: 100 mb
    Format: Mac OS X Extended (Journaled)
    Encryption: 25-bit AES
    Partition: Single partition-Apple partition map
    ..and no, i didnt save the password on my keychain
    ...(you can stop laughing now :P )
    I´ve been in contact with Apple Care and we spent about 3 hours trying loads of things with no luck.
    I know im more or less f*ed, but i know there is a lot of smart ppl on this forum.
    If anyone has idea, no matter how crazy, im willing to try it.

    Hi Worm76;
    My suggestion is forget about what was in the encrypted disk image. Write it off as lost.
    It would take someone like the NSA to get it back for you and I doubt very much that you have anything in there to interest them.
    Allan

  • Problem creating encrypted disk image

    I have just moved from an Aluminium PB G4 with 10.3.9, on which I successfully created encrypted disk images and sparse images.
    I now want to do the same on a brand new WD My Book attached to the new Macbook Pro. I open Disk Utility and click New Image. But when I do so, there are fewer options than there are on the old machine. I only have
    Save As
    Where
    Image Format
    Encryption
    No option for specifying size, no sparse option.
    Also, if I try and create a dmg on the My Book, I get 'Unable to create "myfilename.dmg". (Invalid argument)'
    Any suggestions? Thanks

    V.K.'s suggestion worked. Thank you. But now I've found that I get the full set of options in Disk Utility too. Baffled.
    In the week I've been using my new Macbook Pro, I seem to be getting eerily similar experiences, i.e. apps don't work right, then I quit and next time they behave themselves. Yes, I know it sounds weird.
    Is this an appropriate place for me to ask further questions. Namely, what's the best place to find out about 1. read/write v. sparse disk v. sparse bundle? 2. partitions - should I used them, whatever they are? and 3. why are the bigger disk images called CDs and DVDs? If I want a passworded place to put files on my external drive, bigger than 500MB, is there any reason not to use one of the CD/DVD size options?
    Thanks

  • 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)

  • 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

  • Unable to create an encrypted disk image with Disk Utility

    Hi:
    With our upgrade to Lion a few weeks ago, we're now unable to create an encrypted disk image of any type using Disk Utility any more. This problem occurs on 3 different machines, and is reproducible whether one is using an internal HD or an external FW HD. We can successfully create nonencrypted disk images.
    This is a duplicate post with all the details here: https://discussions.apple.com/message/18469359#18469359
    We haven't had any luck with a solution trying various permissions fixes as helpfully suggested by other readers in response to the error message # (-60008 error), so I'm hoping that someone else has run across a solution from the encrypted disk image perspective and that this tag line will generate some help.
    Thank you!

    Save As: 01 (on Desktop)
    Name: 01
    Size: 100 MB
    Format: Mac OS Encrypted (Journaled)
    Encryption: 256-bit AES
    Partitions: Single partition- Apple Partition Map
    Image Format: read/write disk image
    At the password window that pops up I enter: 1234567890
    This says password strength is "Weak"
    All works fine
    Then I repeated this using:
    Save As: 02 (on Desktop)
    Name: 02
    Size: 100 MB
    Format: Mac OS Encypted (Journaled)
    Encryption: 256-bit AES
    Partitions: Single partition- Apple Partition Map
    Image Format: read/write disk image
    At the password window that pops up I enter: 1234567890 and when I start to enter the next "1" I get the "Unable to create "02.dmg." (error -60008)
    OS 10.7.4
    Disk Utility Version 12.1.1 (353)

  • 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.

  • Disk Utility - Create encrypted disk images super sloooow

    Trying to create encrypted disk images via Disk Utility on my iMac (i7 8GB) is super-slow in 10.8.   It worked quite fast in 10.7, but now it's super-slow and doesn't even seem to ever finish.
    I've tried re-installing 10.8 with no difference.
    Anyone else having trouble with this?  Even a small dmg (~200MB) doesn't seem to work.
    Unencrypted images seem to work OK (if not a little slow).
    I realize that the encryption process will be slower but something is definately wrong with 10.8 disk utility in this regard.  I have 1TB+ free space.  I have tried with another user account as well.
    My task was: (new disk image, read-write, 128bit encryption)
    2012-09-03 08:59:59 -0400: Initializing…
    2012-09-03 09:00:00 -0400: Creating…
    2012-09-03 09:03:28 -0400: Copying…  <<< seems to be stuck here...

    Good morning,
    Have you tried using Disk Utility from within the recovery mode? (Hold down CMD and R when booting)
    I used to have this problem but creating them this way really improved the time.
    Give it a go...
    Rob

  • 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.

  • 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.

Maybe you are looking for

  • Photoshop CC really bad lagging on new rMBP

    I resently bought a new Retina MacBook Pro 13" with a nice fast 2,8 i7 proccesor and a big chunk of 16 Gb ram. After using it on my older iMac I was exited to use it on my new MacBook. But its lagging really bad. It makes it unusable for me. I don't

  • "Error While creating Process Chain"

    Hi all, I am Creating a process chain in that I have to load from ODS to Cube, If I include process types "Activate ODS" and "Update ODS" in process chain its Loading Delta from ODS to Cube,  But my Requirement is to load FULL LOAD from ODS to Cube,

  • Pswsync fails when groups sync fails

    pswsync fails to retrieve remote id when groups sync fails Resync fails when I enable group sync. I can't succeed to resync as soon as I disable the group sync, everything comes OK again It could be mapped to http://forums.sun.com/thread.jspa?message

  • Is there a profiler in Visual Studio Express 2013 for Windows Desktop?

    Is there a profiler in Visual Studio Express 2013 for Windows Desktop?  I can't seem to find the option anywhere.

  • Where are the windows with the folder pictures ?

    I suddenly realized that I'm no longer seeing the window at the top of the bookmarks window with the various folder pictures that changed as you clicked on a book mark within a folder. (I'm not even sure I'm asking this question right?) I recently do