Problems mounting volumes without dialogue

I'm trying to cobble together a script that will mount a network volume that I want to use for unattended scheduled backups, and I've run into a hitch I can't seem to get around....
I want the script to use the Keychain entry for the server in question, so that I don't have to encode usernames or passwords into it. However, I also want it to be able to mount the volume without bringing up the "Select which volumes you wish to mount" dialogue every time it gets run
Here is my script (courtesy of a number of other submitters here)
set server_name to "MyServerName" -- change this to the server name listed in Keychain Access for the server entry you want to use
tell application "Keychain Scripting" to launch
set _processes to ""
repeat until _processes contains "Keychain Scripting" -- this repeat is to work around a known bug
tell application "System Events" to set _processes to name of processes
delay 1 -- this makes sure "Keychain Scripting" is running
end repeat
tell application "Keychain Scripting"
set key_count to count of keys of current keychain
repeat with i from 1 to key_count
try
if protocol of key i of current keychain is AFP and server of key i of current keychain is server_name then
set _password to password of key i of current keychain
set _username to account of key i of current keychain
set _address to address of key i of current keychain
set _volume to volume of key i of current keychain
exit repeat
end if
end try
end repeat
end tell
set intad to "afp://" & _address & "/" & _volume
tell application "Keychain Access"
mount volume intad as user name _username with password _password
end tell
The PROBLEM is, if I run this script using the password provided by Keychain Access, the "Select which volumes you wish to mount" dialogue appears and waits for me to hit OK (not very good if this is supposed to be unattended). If I instead put the password directly into the file (set _password to "blah", for example), the volume mounts without that dialogue BUT my password lives in the file... Not very desirable, especially if I want to give this script out as an application to other users who want to do the same thing..... Does anyone know any ways around this?

Whoo HOOO, I solved it!!!
Or at least worked around it.... thanks again to you wonderful posters on this forum!!
I inserted a
tell application "System Events" to keystroke return
step JUST BEFORE issuing the
mount volume intad as user name _username with password _password
step in my script.... The dialogue comes up, then disappears....
YAY!
If anyone else has any suggestions, I'm open to them!!!

Similar Messages

  • Mount volume not working in 10.4.6

    Could someone please explain why this script does not work in 10.4.6?
    tell application "Finder"
    activate
    mount volume "afp://192.168.1.100/thesharetomount"
    end tell
    Works fine in 10.3.9 but 10.4.6 gives error "some object was not found"
    Thanks for any info

    Managed to figure out a trick to get around this problem.
    I added user name to the mount command
    tell application "System Events"
    set myuser to get full name of current user
    end tell
    tell application "Finder"
    activate
    mount volume "afp://" & myuser & ":@192.168.1.100/sharetomount"
    end tell
    Now it works but can't figure out why it does not without giving a user name?

  • Disk GUID shown at the Failover Cluster Manager instead of the NTFS Mount Volume Name

    Dear Team
    I have built windows 2012 R2 fail over cluster. The sql server 2012 has been installed in cluster mode. When we add share disk for database it showing like General DBs\\?\Volume{665480bd-12d9-11dd-92ea-001cc442e304}\
    Can you Please explain why it is showing in GUID like this. While in 2008 it is showing as
    O:\Miscellaneous\General DBs .
    Also is it normal to have storage configuration in GUID in win2k12 R2 faliover
    cluster.
    We need to have this NTFS mount volume name in our win2012 server. Pl reply
    Thanks

    No problem it happens if you have drive letter conflict too at times.
    So you can even change drive letter now also, but that must be available by that time.
    However you should follow below method:
    1. Disks initialization, formatting, drive letter assignation and grouping for SQL Cluster should be planned and worked out first before sql server installation and testing failover nicely.
    2. Once you are sure that drive letters are proper and failing is happening fine then you can start installing SQL server.
    3. In future too if you assign existing drive letters of sql server to some other disk then same issues will happen.
    So please be careful on this for example if system database disk drivers get changed then what will happen, even sql server will not for you as drive letters will be missing as system  will get adjust with the drive letter without caring about that
    disk drive letter was carrying system db or just user db. 
    Santosh Singh

  • Stopping Leopard from mounting volumes it finds on the network

    How do I stop Leopard from going out and mounting volumes it finds on the network without my requesting that server be mounted?
    The network at work, is a rather slow, cumbersome, poorly linked network and mounting these volumes, which I do not want, is slowing down everything.
    10.4 did not do this.

    I am having the same problem. There seem to be some kind of hidden links to my network drive, which want to connect from time to time. I am not able to find the respective files.
    Is there anyway to find the files and/or the reason why it wants to connect?

  • Secured WebDAV Mounted Volume Authorization Issues

    I use a secure WebDAV mounted volume from myDisk.se and up until the latest Security Update have had zero issues being able to manipulate files and folders as I would on a normal volume. However, since the installation of the Security Update (2009-004 (PowerPC) 1.0) I find weird things happening with this mounted volume:
    1) I am able to mount the secured WebDAV share using my security credentials.
    2) I can create a default "untitled" folder but when I try to change its name, the WebDAV authorization dialog pops up and despite entering the same credentials (why, I am not sure as the volume has already been properly credentialed in order to be mounted), access is denied.
    3) Trying to create a file within a folder on the mounted WebDAV volume I previously created pre-update causes the same authorization issue.
    I have no other WebDAV shares I can try to mount from any other companies so I am not sure if this is a myDisk issue or one borne from the Security Update. I am not a .Mac/MobileMe user and that info is not filled out in System Preferences. The internal hard drive has been meticulously maintained with Disk and Permissions repair being run both before and after each and every software update installed. Likewise, the volume's structure is also checked both before and after and shows no need for repairs.
    Any ideas? Perhaps there is a corrupted file somewhere that's affecting the authorizations needed by this third-party WebDAV volume?
    The machine that has this problem is the last model iBook G4/1.33GHz 12" display, 1.5GB RAM, and a 100GB 5400rpm HD which replaced the stock OEM 40GB 4200rpm drive about one year ago.
    I'm not willing to do an Archive and Install at this point as the loss of the WebDAV access to my online volume is not critical. Inconvenient as heck but not to the point where I'm willing (or able) stop my normal work to spend the hours it will take to get WebDAV access back.
    Thanks in advance for any insights.

    same problem here with webdav, I can't mount my idisk from university network on Mac Pro 10.5.3 (although it mounts fine from home network on both ibook and PMG5 10.5.3). Everything was fine with 10.5.2 and I already re-installed 10.5.3 combo. Other bugs as well with .Mac prefs (keeps crashing, sometimes it shows the available space on idisk but still no mounting, with error -35 or -8086), but .Mac sync is OK
    Jun 11 12:34:21 webdavfs_agent[579]: mounting as authenticated user
    Jun 11 12:34:22 kernel[0]: webdav server: http://idisk.mac.com/[username]/: connection is dead
    Jun 11 12:34:22 KernelEventAgent[75]: tid 00000000 received VQ_DEAD event (32)
    Jun 11 12:34:22 kernel[0]: webdav_sendmsg: sock_connect() = 61
    Jun 11 12:34:22 KernelEventAgent[75]: tid 00000000 type 'webdav', mounted on '/Volumes/[username]', from 'http://idisk.mac.com/[username]/', dead
    Jun 11 12:34:22 kernel[0]: webdav_sendmsg: sock_connect() = 61
    Jun 11 12:34:22 KernelEventAgent[75]: tid 00000000 found 1 filesystem(s) with problem(s)
    Jun 11 12:34:22 kernel[0]: webdav_sendmsg: sock_connect() = 61
    Jun 11 12:34:52: --- last message repeated 1 time ---

  • Not searching mounted volume?

    Recently got a new mac with the OS X 10.7 and the finder search doesn't work on mounted volumes.
    It searches the mac HD fine.
    Any ideas?

    Did you follow my earlier suggestion:
    You can also use Spotlight, but check in Spotlight prefs to make sure none of your disks are excluded (beware that not excluding your disks could take Spotlight a while to index after a reboot...)
    System Prefs > Spotlight > Privacy
    If the list is empty, then all your drives are included.
    That dialogue should look like this (i.e., there should be nothing in the blue/white listing pane):
    BTW, if you are new to Mac, be sure to read this:
    http://support.apple.com/kb/HT3737

  • Disk Utility: Create Image from Volume Without Unused Space

    I'm trying to create a disk image from a mounted volume (flash memory in a video camera) but I don't want to write to it later, it's just for archiving. The problem is that the size of the original volume is 16 GB, so every image I create is huge, even if there is less than a 1 GB used.
    For example, I only have two short clips on there, about 1.1 GB used. When I create a new .dmg from the volume, the file is 5.28 GB and when I mount it it tells me the size of the volume is 15.3 GB. Clearly I understand why this is happening, it's creating a bit for bit copy of the original volume, but I don't need all that space since I'm never going to write to it.
    In disk utility it won't let me resize the image (it's grayed out). What do I do?

    I actually don't understand why this is happening (when I do this the created disk image only uses the space it needs) but you can get around it as follows. First create a blank read/write disk image to the size you want and then restore the memory card to that image.

  • Mount volume script doesn't work after upgrading to Yoesmite

    I just upgrade my Mac OS to Yosemite and the boot up mount script doesn't work again.
    try
    mount volume "afp://admin:[email protected]/Multimedia/Music"
    mount volume "afp://admin:[email protected]/workspace"
    end try
    Should I modify the mount script and how to do that?
    Thank you so much.
    Matthew Ho

    I am having the exact same problem. I just did a complete re-install of max os x and did all of the updates..my hard drive had crashed so i had to replace it. lot's of fun.. and after the last upgrade i can't use my sound at all.. the sound shows that it's all the way up but it has the "no Smoking" sign as well..
    i have tried to restart.. change options and whatever else i could .. i did notice that when i enable the option to show the sound icon on the main bar that there is just a blank spot where it should be.. and i can't change it form there either because it just doesn't show..
    any one seen this before.. ?
    all my other Mac's work fine..
    please help..

  • Lion Recovery Disk erased mounted volume

    Has anyone had this problem: I created a Lion Recovery Disk and it erased mounted volume? Can the data be recovered?

    That was my backup. I'm transfering all my files from my laptop to the iMac and other devices. It also is loaded with older photos that I don't keep on any other devise. my bad. I am begining to read the files for recovery using 'DISK DRILL" working beautifuly. no recovery yet but prospects are good!

  • Show mounted volumes in the Sidebar (not servers)?

    Anyone have a Leopard tweak or hack to get the side bar to show mounted volumes (i.e.; share points), rather than servers? I need to see the share points, not the server itself (especially when Kerberos is enabled - its just plain goofy)
    I like Leopard's Finder improvements for the most part, but need my sidebar to show discreet mounts like 10.4 (Tiger) did. Idont want to see the entire server thats hosting the mounted volume - thats just plain silly. I can use the "Connect to Server" app for that ( or browse the LAN)
    Dragging mounts to the sidebar will work (they show up as "devices"), but they are forgotten after a reboot. Its a temporary solution at best.
    Is this a bug? A limitation? A disaster? A feature?

    I'm not quite sure what your complaint is. You still have the same option to manually connect via the "Go" menu as with Tiger, do you not? Does this not still result in mounted volumes appearing in the devices list? (BTW, "devices" is the appropriate generic name for them in a UNIX environment -- don't blame Apple for that, it is just following a naming convention older & more established than those of either the Mac or Windows OS's.)
    If people are confused by the "Shared" section of the sidebar, which is a convenience item not essential to creating sharing connections, why not just suggest they remove it? A set of Finder preferences exists for this purpose. Deselect all three & no "Sharing" sidebar section will appear. Apple is not forcing anyone to use or see it unless they want to.
    Moreover, Apple is not the originator of SMB, which has its origins in DOS, was modified by Microsoft in ways to this day not completely documented in any open standards, & must be reverse engineered for interoperability with other OS implementations. Not surprisingly, it must be configured carefully on the server side with this in mind for it to work reliably, which is no easy task since (among other things) its performance, ease-of-use, & security can't all be maximized at the same time. This is hard enough in a pure Windows Server domain environment, much more difficult in a mixed platform one.
    Because of this, it may be premature to blame all the connection anomalies on Leopard and/or Finder's sidebar. A review of the protocols & settings used in your shop's SMB servers' implementation may turn up something helpful here, but that is probably best done by a network specialist familiar with the issues involved.
    As a side note (& by way of an example), SMB incorporates "auto-discovery" too, just in a more limited way compared to Bonjour. Typically, to maintain network security, it is configured to auto-discover only on a client's initial contact with the server, & there are sometimes reliability issues with this mechanism on large networks due to latency, which may explain some of the problems your users are having.
    So, don't be too quick to blame all this on Leopard alone -- as with all network issues, one must look at the entire network to identify causes & their remedies.

  • Problems mounting a Sony DVD+R DL disc

    Hi I have a MacBookPro 2,2 - Intel Core 2 Duo - 2.33 GHz - 15''
    When I load a blank Sony DVD+R DL 8.5gb - AccuCore - RW - disc into Finder it shows up fine, burns without a problem (I burned it with finder), mounts after its done without a problem, it ejects without a problem.
    Now when I try to use the disc the next day. It wont mount. The drive tries to read it for 30 seconds and than just ejects it back out. I have Toast 7 Titanium but I mainly use it to make movie DVD's with DVD+R's for clients.
    I thought maybe the disc's are bad or something. So I did a little experiment using Parallels Desktop with Windows XP SP2 on it. It loaded the disc into the drive and it showed up. Seems that the drive nor the disc are the problem but the OS.
    Any help on this would be awesome.
    MacBookPro 2,2 - Intel Core 2 Duo - 2.33 GHz - 15"   Mac OS X (10.4.9)  

    Raul,
    No thanks to yourself and Sony you are in this pickle. You allowed yourself to have less than 2 copies of your data, and Sony for not following the DVD+R DL standard that Apple has tried to follow with the rest of the industry. Unfortunately the rest of the industry can't agree upon a standard. It really is too bad that's the case, but that's the situation with the bleading edge on media format. DVD-R is more reliable than DVD+R DL.
    That's where the problem happened. Apple didn't tell you to delete the data.
    My suggestion is to follow my backup FAQ*:
    http://www.macmaps.com/backup.html
    to avoid such problems in the future.
    You may be able to recover the information with Prosoft Data Rescue, or Subrosasoft's File Salvage.
    Good luck!
    * Links to my pages may give me compensation.

  • Windows Server 2012R2 Failover Cluster error with mounted volumes

    Hi all,
    I've a problem with mounted volume on a WSFC build on top of Windows Server 2012R2, the situation is:
    M: is the volume hosting mounting points
    disk-1, disk-2, disk-3 are volume mounted on M:\SomeFolder
    Theese volumes are used by a SQL Server Failover Cluster Instance, but my problem is related to WSFC. I've set dependencies so disk-1, disk-2, disk-3 depend upon H:
    If I try a failover of the role "SQL Server" I observe that when the disk come online in the other node they fail with this error:
    Cluster resource 'disk-1' of type 'Physical Disk' in clustered role 'SQL Server (ISQL2014A)' failed. The error code was '0xaa' ('The requested resource is in use.').
    Based on the failure policies for the resource and role, the cluster service may try to bring the resource online on this node or move the group to another node of the cluster and then restart it.  Check the resource and group state using Failover Cluster
    Manager or the Get-ClusterResource Windows PowerShell cmdlet.
    If I manually take offline H: and than bring it online and then manually take online all disk (1 to 3) they come online with no error.
    I'm going crazy!

    I've found the root of the problem: the servers are virtual machine on a VMware ESX 5.5 infrastructure, VMware claims that on 5.5 multipath is supported for raw device mapping disks but disabling multipath (I've set to fixed path) the Windows Server Failover
    Cluster stops to get problems.
    Now we have opened a support call with VMware.

  • Searches within InDesign Have Stopped Working on AFP Mounted Volumes On OS X 10.9

    I have run into a new problem since using InDesign CC on a Mac running Mavericks, the search function has ceased working on AFP mounted volumes. For example, when placing an image, if I navigate to a pot of images on my server and then tap in part of the file name within the search field there is nothing found, even though the file name I am searching for is there.
    I have spoken to Adobe technical support who said "well I do apologize for your inconvenience however adobe does not support if the file is on the network. We would be happy to help you if there is any issue with Search if the files are located locally". Slightly frustrating answer!
    This issue looks to be related to the Mavericks operating system as I have Macs running OS X 10.8 which are fine, it is only the OS X 10.9 Macs that have this problem. Is anyone else having these issues?

    I have no problem on two Macs running Mac OS X 10.9.2 with InDesign CC 9.2.
    Have you started by restoring your preferences. Here's how:
    Trash, Replace, Reset, or Restore the application Preferences
    If you use the delete folder method, remember that in OS X 10.9, the <Home> library his hidden. In the Finder, hold down the Option key, and choose Go > Library to make it visible.

  • Problem: Mount Failed

    Whenever I launch iPhoto 7.0.1 I get the following message:
    Mount Failed.
    Could not mount volume "My Book".
    If I click "OK" The message pops up again over and over untill I quit iPhoto
    My Book is å WD My Book Pro connected via Airport Extreme.... or it WAS connected... it no longer works. No pictures from the library were stored on the disc. I tried deleting iPhoto and airport disk util's plist files. I also moved the library, so iPhoto would not find it. After doing all these things, and rebooting, I still have the problem (with a new library w/o any photos!)
    The problem is user spesific; other users are not affected.
    Any help would be appreciated

    Thanks for the tip. I had the same problem and indeed it was fixed by removing aliases to disk images from my User >Movies folder. However, I need those aliases there in order to access different disk images for viewing movies using the menu system in Front Row with the remote control on my iMac. Hopefully Apple will release a fix for this. Can anyone think of a workaround in the meantime?

  • Z10 cannot mount volumes

    New connection but z10 not recognised and mount volumes does not work. Play book threads suggest top/ip not running but mine is windows 7, any simple help appreciated Chris

    uninstall BlackBerry Device Services and then plug in Z10 and wait for about 5 min to install drivers
    I did this on my 64 bit 7 os
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

Maybe you are looking for

  • HT3529 will imessaging work on two iphones using the same apple id

    will imessaging work on two iphones using the same apple id

  • Problem with soap receiver adapter

    Hi All I have Idoc sender and soap receiver in my scenario. I am calling web service deployed on WAS. The web service is getting called but the acknowledgement message in xi contains following system error acknowledgement because of which xi changes

  • Bad image resolution on TV when mirroring.

    I have AppleTV HD and Macbook Air (OS10.8.1). Mirroring worked pretty nice for 3 months, but recently the image on my TV started to have very bad resolution and slow response to image changes. I checked out all wires, internet connection, reset all d

  • How to get current function name?

    Hello, everyone! I want to get the current function name for debug purpose. I simply want to dump out current class name, function name (and better line number) of current executing statement. For example, I can embed my debugger inside my source cod

  • Cpu operating temperatures

    Would anyone know the safe operating cpu temperatures of a 2.1 imac isight. thanking you