Stumped by mount volume quirk

Okay, this works fine:
set Uname to "<my_username>"
set Pword to "<my_password>"
set someVolume to "afp://168.116.236.41/MHCProduction"
mount volume someVolume as user name Uname with password Pword
If I run this script, the volume in question mounts immediately. However, when I incorporate the above concept into a slightly more involved script, when it gets to the mount volume command it throws up a dialog asking for the server address. The mount volume command is built identically (in fact I cut and pasted it from one script to the other. The only difference is that in the longer script, the URL string in someVolume is read from an external text file and the username and password are initally entered via a dialog box and thereafter stored in properties of the script. Here's the code from the longer script:
property Uname : missing value
property Pword : missing value
global selectedVolumes
my checkProps()
tell application "Finder"
set thePath to (path to application support folder from user domain as string) & "<path:to:textfile>"
if (exists file thePath) then
set selectedVolumes to my readPrefs()
end if
end tell
repeat with someVolume in selectedVolumes
mount volume someVolume as user name Uname with password Pword
end repeat
on checkProps()
if Uname is missing value then
set Uname to text returned of (display dialog "Enter your Username:" default answer "")
end if
if Pword is missing value then
set Pword to text returned of (display dialog "Enter your Password:" default answer "")
end if
end checkProps
on readPrefs()
set prefFile to open for access (((path to application support folder from user domain) as string) & "<path:to:textfile>")
read prefFile using delimiter return
end readPrefs
can anyone tell me why the mount volume command goes off without a hitch in the first instance, but not in the second? I've verified that the URL string is correct in the second script using 'display dialog someVolume' right before the mount volume command, and it shows a properly formatted URL string (afp://yadayada/yada).
Any input greatly appreciated.
St!ff
Dual 2.0 GHz Powermac G5   Mac OS X (10.4.4)  

I've discovered a much quicker and more relaible means to accomplish this:
property Uname : missing value
property Pword : missing value
global selectedVolumes, theIteration
my checkProps()
tell application "Finder"
set thePath to (path to application support folder from user domain as string) & <path:to:textfile>
if (exists file thePath) then
set rawData to my readPrefs(thePath)
end if
end tell
set cleanData to (characters (offset of <ServerIP> in rawData) thru -2 of rawData) as text
set {oldTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set selectedVolumes to text items of cleanData
set AppleScript's text item delimiters to oldTIDs
set theIteration to 1
repeat with someVolume in selectedVolumes
set theDir to "/Volumes/mntpnt" & theIteration
set mkdirCmd to "mkdir " & theDir
set mountCmd to "mount_afp afp://" & Uname & ":" & Pword & "@" & someVolume & " " & theDir
try
do shell script mkdirCmd
do shell script mountCmd
on error errMsg number errNum
display dialog "Error! " & errNum & return & errMsg & return & someVolume
set theCleanupCmd to "rmdir " & theDir
do shell script theCleanupCmd
end try
set theIteration to theIteration + 1
end repeat
on checkProps()
if Uname is missing value then
set Uname to text returned of (display dialog "Enter your Username:" default answer "")
end if
if Pword is missing value then
set Pword to text returned of (display dialog "Enter your Password:" default answer "")
end if
end checkProps
on readPrefs(somePath)
set prefFile to open for access somePath
set theData to read prefFile
close access prefFile
return theData
end readPrefs
Dual 2.0 GHz Powermac G5   Mac OS X (10.4.4)  

Similar Messages

  • Duplicate on mounted volume

    Hi all
    Im putting this script together using AS Studio, the script mounts a volume then goes to a specific folder checks to see if their are files in it that are less than 24 hours old then duplicates them to another folder then unmounts the volume.
    I cant seem to get the files in the folder "Abf:untitled folder:" which are less than 24 hours old to duplicate to folder "Abf:untitled folder 2:", can I get some pointers as to where im going wrong please?
    on clicked theObject
    if name of theObject is "get" then
    tell window "main"
    set Comp_Name to name of current menu item of popup button "COMP"
    set current menu item of popup button "COMP" to first menu item of popup button "COMP"
    end tell
    if (Comp_Name is "ABf") then
    set aDayAgo to the (current date) - 1 * days
    tell application "Finder"
    set myVolume to mount volume "afp://APf:[email protected]/APf"
    delay 5
    get every file of alias "Abf:untitled folder:"
    repeat with thisItem in the result
    if the modification date of thisItem comes after aDayAgo then
    try
    tell application "Finder" to duplicate thisItem to "Abf:untitled folder 2:"
    end try
    end if
    end repeat
    delay 5
    tell application "Finder" to eject "Abf:"
    end tell
    end if
    end if
    end clicked
    Cheers
    Budgie

    Im stumped, and a bit lost, due to my nievity with AS, ive got as far as the below and tried numerous things, but I keep getting the same result.
    AppleScript Error.
    "Finder got an error: Can't get every file of "/Volumes/Absolute Proof/untitled folder/". (-1728)"
    am Im missing the obvious?, or am I a bit thick? (be kind)
    could I get a bit of help with sorting this please?
    on clicked theObject
    if name of theObject is "get" then
    tell window "main"
    set Comp_Name to name of current menu item of popup button "COMP"
    set current menu item of popup button "COMP" to first menu item of popup button "COMP"
    end tell
    if (Comp_Name is "AB-Proof") then
    mount volume "afp://HD:[email protected]/AP"
    delay 5
    set aDayAgo to the (current date) - 1 * days
    tell application "Finder"
    --update folder "AP:untitled folder:"
    run script "Tell app \"finder\" to get every file of POSIX path of alias \"AP:untitled folder:\" "
    repeat with thisItem in the result
    if the modification date of thisItem comes after aDayAgo then
    duplicate thisItem to "AP:untitled folder 2:"
    end if
    end repeat
    end tell
    end if
    end if
    end clicked
    cheers
    Budgie

  • Delete File From Mounted Volume

    Hey,
    I am trying to delete the "Calendar Cache" files on both my laptop PowerBook G4 and the Mac Pro Quad that I sync my calendars with. I am using ChronoSync and the individual calendars sync fine, but there is a little house keeping needed with the cache file. They need to be deleted on both systems in order to "refresh" the views of the calendars.
    So after the sync of calendars, I have the software initiating an AppleScript that deletes both. Here's the script:
    +(* PowerBook Files / delete cache file *)+
    +(* Please note that both systems have the same username. This may be arise a conflict *)+
    +tell application "Finder"+
    + activate+
    + tell application "Finder" to delete file "Calendar Cache" of folder "Calendars" of folder "Library" of disk "useranthony"+
    +end tell+
    +(* Mac Pro Quad/ delete cache file *)+
    +tell application "Finder"+
    + mount volume "afp://10.10.10.1/anthonyabraira"+
    + tell application "Finder" to delete file "Calendar Cache" of folder "Calendars" of folder "Library" of disk "/volumes/useranthony"+
    +end tell+
    I am having trouble addressing a deletion on the networked Mac Pro Quad.

    why send it to the trash — just delete it...
    (* PowerBook Files / delete cache file )
    try
            do shell script "rm -rf /Library/Calendars/Calendar\\ Cache"
    end try
    you may need a delay for the Mac Pro Quad to mount
    ( Mac Pro Quad/ delete cache file *)
    --the mount and then the delay
    delay 4
    try
            do shell script "rm -rf /THE-CORRECT/PATH-HERE/Library/Calendars/Calendar\\ Cache"
    end try
    Tom

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

  • Change ownership from "system" on mounted volume?

    I have an external firewire drive with 3 partitions all of which are mounted on an iMac, and which until recently all had the same ownership and permission settings under my admin account. One of the volumes (the one storing all the users' iTunes songs) somehow changed ownership to "system" and group to "wheel". I can no longer access the volume nor can the other user accounts on the iMac, although it shows up as a mounted volume when viewed in Disk Utility. "Repair permissions" is unavailable for this volume in Disk Utility. The other two volumes are unaffected and retain the original ownership settings. I'd like to reset ownership from "system" to my admin account, but do not know how to do so as apparently it needs to be done through unix commands using Terminal. What do I need to do?
    iMac   Mac OS X (10.4.8)  

    "...under Ownership & Permissions, click on the lock, enter your password, and change the Owner to you, with R&W access and the Group to admin, also w/R&W access, and click o Apply to enclosed items. Click the lock and close the Info window. No need to use Unix commands in the Terminal app."
    I first tried that approach but unfortunately the procedure does not work. Under Ownership & Permissions it says "You have No Access". I can click on the lock and select my name under Details: Owner, but once I click to relock, Owner just reverts back to "system".

  • 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

  • Deleting A Mounted Volume

    I previously created a 20GB mounted Volume using Disk Utility as a way of keeping track of files I needed to back up once I bought an external hard drive. However now that I bought one and backed up my computer, I need help deleting the volume.
    Here is the information I have on the volume if it helps:
    Type: Volume
    Disk Identifier: disk1s2
    File System: Mac OS Extended (journaled)
    I just want to get rid of the volume altogether not just format it and I want to put the 20GB back to my Hard Drive total.
    Any help is appreciated. Thank you ahead of time.

    Sorry I just wanted to add a little bit of information. The volume I named data.dmg is still there. That is the item I am trying to delete and have the free space go back to my hard drive.
    Again thank you for the help.

  • Mounted Volume Not Showing On Desktop or Sidebar

    Our company uses a Mac Mini running OS 10.10 Yosemite to share files. File Sharing is setup to share contents on the Mac Mini with other Macs and PCs. Sharing is working fine. However, in the last couple days when logging into the Mac Mini the mounted volume (Mac Mini) no longer shows on the desktop, sidebar or when accessing the client hard drive. In order to access the Mac Mini after mounting via log in an alias to the Mac Mini needs to be created and access via the alias. Folders from the Mac Mini can be added to the side bar and accessed that way, but the main folder for the Mac Mini is only accessible through the alias. Preferences in the Finder are set to show mounted volumes and servers on the desktop.
    Computers accessing the Mac Mini are running OS 10.6, 10.9, 10.8.

    Check the settings in the General tab of the Finder's preferences.
    (69253)

  • Mounted Volume not shwoing up with Windows 2012 R2 failover cluster

    Hi
    We configured some drives as mounted volumes and configured it with Failover cluster. But it's not showing up the mounted volume details with Cluster Manager, it's showing the details as seen below
    Expect support from someone to correct this issue
    Thanks in advance
    LMS

    Hi LMS,
    Are you doubt about the disk shown as GUID? Cluster Mount point Disk is showing as a Volume GUID in server 2012 R2 Failover Cluster I creating a mountpoint inside the cluster
    and had the same behavior, instead of mount point name we had the volume GUI after volume label, that must by design.
    How to configure volume mount points on a Microsoft Cluster Server
    http://support.microsoft.com/kb/280297
    I’m glad to be of help to you!
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Finder throwing error -1401 when attempting to open files on mounted volume

    Alright, this is driving me nuts. At random, Finder will refuse to open files on a mounted volume on my server. It throws the error "The application can't be opened. -1401" and then "The operation can’t be completed. An unexpected error occurred (error code -1401)." back to back. It doesn't matter what the file type is, as far as I can tell (.jpg, .xlsx and .pdf are on there).
    From that point on, I can navigate those volumes to the point that I have navigated them since the volume was mounted at start up, but can't go any deeper into the directories or open anything. Finder also won't eject the volume. I can't open files from within applications, either.
    I have to reboot for it to work again.
    However, if I jump into Parallels I can open anything on the server. Even Acrobat files, which open in the Mac environment and not within the virtual machine.
    Does anyone have any insight to what might be causing this? I searched and can't find anything.
    Thanks,
    Brian

    Restart your computer with the Shift key held down,
    and then open the Startup Items folder inside the
    System Folder. Throw away all of the aliases you find
    in this folder and then empty the trash.
    To quit AppleWorks or another application when it
    won't respond, hold down the Option, Command, and Esc
    keys, and then click the Force Quit button. You
    should also use the Disk First Aid application in the
    Applications (Mac OS 9):Utilities folder to verify
    your hard disk, as something may have been damaged
    when you shut the machine down using that method.
    (11882)

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

  • Mounted Volumes doesn't show automatically in Finder Window

    Hi, is it a preference that allows me to have access directly to my mounted volume (like in OS 10.5) in the Finder windows? Right now, i have to drag them manually so they show next time i mount them. I would like to see the mounted volumes in the Devices section, below my Hard Drive icon.
    I know i can access them via the Shared section but thats one more click to do… yeah, i'm lazy
    Thanks
    Ben

    Let's take one more shot before we admit defeat...
    Go to Users/yourname/Library/Preferences
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Drag both files to the desktop
    Then, restart.
    (You will have to reset a few finder prefs the way you like them.)
    -mj

  • Information about mounted volumes

    Hi,
    I am trying to write an Applescript to quickly generate links to files on mounted volumes, which then can be pasted into emails.
    I would like to have the user select a file/folder on the mounted volume; when he executes the script (either from the script menu, or as an Automator action), it would copy the full path (ie afp://server.local/file) into the clipboard.
    The information is accessible from the "Get Info" window, but I can't find a way to read it in AppleScript.
    Any thoughts and pointers are appreciated.
    Best regards // Pascal

    Hi Budgie,
    thanks for the link. Unfortunately the solutions mentioned on that page stop at providing the POSIX path (/Volumes/share/file). I would need to get some information about the actual server, from which the share is mounted.
    Thanks for the tip though.
    //pascal
    Message was edited by: Pascal Wever

Maybe you are looking for