AppleScript to change mounted network drive icon?

Howdy,
I have 3 networked Windows 2003 drives that I use everyday for my work. Now OS X networking is a bit iffy, and the way it maps drives is a bit weak compared to windows... in the way you have to remap the drive everytime you login and everytime after the machine sleeps!
Well I have a AppleScript that is in my login items and runs every login to map these drives. I also have SleepWatcher installed, and it runs the same script after the lappy wakes up... it maps them fine and all is good (although I hope one day Apple fix it so that the drives stays mapped permantely like Windows!).
Well I have one problem, I apply my own icon to these mapped drives, and when they are mapped after login/wake sometimes all the icons keep this new icon, or other times they go to a standard folder icon? Its very random, and it happens at least 1 in 2 logins, and its also random what drive it gives the dud icons too!
So I think the best way to get round this would be to add some applescript to my existing script that will tell the drive to use the new icon. Can this be done in AppleScript? Can I add to my existing script a new line that says apply "x" icon to "x" mapped drive?
Any applescript genius's out there who know this, you help will be appreciated!
ta
Steve M

Doubtful that you'll do it in one line, but there are approaches.
One is to get AS to open the get info window for the the icon you want to customize AND the get info window for a folder with the custom icon you want to use, then paste one to the other (with AS). This is straightforward if you do it manually, and I once made it happen with AS but found it so cumbersome that I never really used it.
Another approach is a "do shell script", using commands from some brief software called osxutils that can be downloaded for free. You should see thread http://discussions.apple.com/thread.jspa?threadID=1105260&tstart=50 in these discussions. This may (or may not) do the job for you.

Similar Messages

  • Mount network drives

    Hi,
    How can I create a script that will connect to a windows server with a username and password and mount network drives on my desktop, and how do I set this script to automatically run when I login?

    Hey guys. I'm glad I found this post. I'm trying for the same result. I currently work at a school in which every teacher has a computer that connects to the local network by signing in with a username and password. However, my computer has fried and they can't get me a new one until... well... whenever. I've brought my MacBook Pro in and have connected to the internet which is great but I need to access a network (H:) drive in order to update progress reports and report cards.
    I don't know much and the IT guy is impossible to reach and hasn't returned any emails. I just need to connect to that one folder. I was assuming and ftp or and smb would do the trick but I have no idea what server I would need to try and access through the finder, applescript, or terminal. I did an ipconfig on another teachers computer and got a few ip's as well as the folder's location on the network 'server_4\folder' (H:) if that helps. I've tried connected by ftp through the finder to all of the ip's and have gotten an error saying that I can't connect. I have also did a whatsmyip.com search for my root ip address and have tried the same approach. For some reason, it connects by says my username and password were incorrect.
    Well that's about everything. Any help would be greatly appreciated!

  • How in the HECK can I change my Hard Drive icon??!??!!

    I've tried searching these discussion forums for how to do this, but the question has always remained unanswered! Does ANYbody know how to use this? I'd buy applecare but I'm a student and can't afford it. Would somebody please figure out how to make it so that you can paste a new icon on top of the standard icon for 10.3.9? It's driving me crazy that after I copy the icon I want to use for my hard drive that I can't paste it on top.
    And I've tried doing a permissions repair in Disk Utility.
    400 MHz PowerPC G4   Mac OS X (10.3.9)  

    That's how other people do it, HVlaar; it's the standard procedure. Works fine for me. Are you logged into an admin account? Have you considered that changing your hard drive icon probably isn't an important thing to do anyway?

  • Fast User Switching with Mounted Network Drive?

    I have a headless G4 Cube running 10.5.8 with a 2TB firewire drive plugged in for storage accessable to any of my macs here at home. I can access it fine with my 2 desktops over ethernet and wirelessly. Recently we decided to consolidate our 2 desktops into one using the muliple users feature. Seems to work fine, and both accounts can access the shared drive. They are logging in with the cube's admin credentials, and the shared drive is set to ignore permissions. I have the drive set to mount on login with a startup item in the system login items prefs. As long as I logout before switching users, everything is good.
    The problem arises with Fast User Switching which we'd love to be able to use. I can't figure out how to connect to the drive in one account without the 2nd account then seeing it as a volume without proper permissions, then that account creates a new volume mount for it (which doesn't work with iTunes properly and seems to cause other wierd issues).
    Example: So say 'user1' logs in, mounts the drive 'Jukebox'. everything seems OK so far. 'Jukebox' is on the desktop and iTunes finds the music. Now I fast user switch to 'user2' and there is a 'Jukebox' on the desktop with the red minus icon indicating I don't have permissions to access it. If I then browse the network and mount the drive, I end up with ANOTHER 'Jukebox' on the desktop. BUT iTunes doesn't see it properly. If I look in the /Volumes/ folder with the Terminal, I see a mountpoint for 'Jukebox' (with the owner of 'user1' group 'staff') and now a new mountpoint called 'Jukebox-1' (with the owner of 'user2' group 'staff').
    It seems when you mount a AFP drive, it creates the Volume with the current user and staff group, but switching to another user then can't access that when it sees it in the /Volumes folder. You try to mount again and it creates a NEW mountpoint, names it with a '-1' at the end and you can use that (but iTunes cant).
    So... how does one use a shared drive that you want on BOTH users desktops with Fast User Switching turned on? Is there a way to have the drive mounted BEFORE either user logs in, such that it will be seen as any other local drive (which doesn't have the issue)??
    Or is there some other way I can attach to the network volume in each account on login so both have access to music and videos with full permissions?
    I'm really stumped here after 2 hrs of googling, searching here and trying things.
    TIA

    I've not had any luck with the suggestions in the link either.
    Here's two other approaches I've tried and failed with:
    1. Creating a new share point on the cube itself so that one user can mount it as a different volume. Then the issue is that I still don't have a volume named "Jukebox" available to each user when switching. I DO have access now to the data from both accounts, but under 2 different mount points (volume names) and the xml file for iTunes is hard coded with the path for each mp3 including the "Jukebox" volume name... so no go.
    2. Tried figuring out a way I could script a mounting of the share with the terminal thinking I could then run that shell script at startup. Can't seem to get the sytax right. If I create a directory in /Volumes and mount and afp share to it, it takes on the ownership of root/wheel which I can't access in the finder and can't seem to change.
    BUT I'll keep playing with both these ideas a bit... the first one might be overcome with a bit of logic and the 2nd if I can get the syntax right to mount the share with afp_mount and give it the correct ownership/permissions such that when a user logs in she/he sees the volume on the desktop and has full r/w access to it.
    thanks again. if you offhand know the syntax for that, let me know

  • Mounting network drives in the left pane of the finder...

    in tiger, i was able to mount a network drive and have it show up in the left pane of the finder. now, when i connect to a network drive (clicking "go", "connect to server", and typing the IP address). it opens up a new finder window with the contents of the network drive, however, it doesn't show up in the finder pane...
    also, the "network" icon in the left pane is gone. is there a way to bring this back?

    Does this work for you?! I can't get this to appear, least i have the icon on the desktop now but having it in the finder is what I really want,
    Some very good features in Leopard but they really do seem to have messed around with things unnecessarily, custom firewall changes, network mounts appearing etc etc

  • How to mount Network drives on log-on

    Hi
    I'm trying to implement some Macs in a large network.
    We work against file servers, storing all the files we use on the servers.
    There are multiple servers with multiple shared folders in each.
    On the windows work stations, we click "Map network drive", Choose the server and folder and check "Re-connect on startup".
    How can I do this in OSX.
    Here is what I need:
    *On log on the mac should mount each network share, so that it is accessible in finder like any other drive.
    *It needs to have the same drive-letter each time, as applications may need to reference the files.
    *It needs to log on using the current user's username and password (the passwords may change, so no putting them in scripts)
    *Should not pop up one finder window pr. drive when you log on (some "solutions" do this)
    Our servers can act as both smb and windows server.
    I'm sure apple has a great solution for this, and it is probably easy, it's just me comming from windows and could not find it.
    Hope my question was clear and that somebody can help.

    That should work. You could try deleting the passwords in Keychain associated with it and try it again.
    Another route: Create Applescript:
    Select the network drive and get info on it. Copy the server address. Open up Applescript Editor in the Utilities folder and create a new script. Type in mount volume, add space, "paste server address within quotations", and save as application to your documents. Run it from within applescript editor to verify it works. When it asks for a passwork, save it in Keychain.
    Under system preferences/accounts/login items, click the + sign to add and select the saved application.

  • How to mount network drive on boot up

    I'd like to mount a network drive on my OS X v10.6 system during the *boot sequence* so that the drive is available to Time Machine to write its backups there. I can mount the drive manually and know how to add it to an user account's loginn items so that it gets mounted when that user logs in. But I want it always mounted regardless of which user is logged in or even if no user is logged in. That way TM can run whenever it needs to.
    So how can I mount the network drive during boot up?
    The network drive is on a machine running OS X v10.5.
    This related thread was my original question in the Time Machine forum: http://discussions.apple.com/thread.jspa?threadID=2807393&tstart=0
    Message was edited by: NikD

    not sure it will work for you but you could try this:
    if you are comfortable with AppleScript, you could edit this script to suit your situation:
    try
    mount volume "afp://<devicename>.local/<volumename>" as user name "<accountname>" with password "<accountpassword>"
    end try
    this script just places the drive's icon on the desktop.
    save it as an application and add that to the account's login items.
    credit for the script goes to Tesserax.

  • External Mounted Hard Drive Icon Not Showing on Desktop nor on Sidebar

    Bonjour,
    I have a portable drive that does NOT show up in the Sidebar nor on the Desktop. The only way I can see and navigate through it is by clicking in Disk Utility > Mount Point: <hyper-link>
    Then hard drive icon and its content show up fine. But the HD icon is slightly dimmed (it is paler than the all other - HD, computer, etc - icons).
    I verified the external HD and it is just fine. I have another eDrive (TechTool Pro 4) partition and it shows up like any normal HDs normally does.
    How can I get the icon to show up back into the Sidebar and the Desktop?
    Is there a "Preference" file I need to throw out?
    Is there a UNIX command I could execute to make it show up again?
    Thanks for your assistance.

    Open the Script Editor in the /Applications/AppleScript/ folder and run the following:
    tell application "System Events"
    set visible of (choose folder with invisibles) to false
    end tell
    When prompted, select your hard disk in the dialog box. Next, log out and back in.
    (24685)

  • Problem mounting network drive after upgrading router firmware

    Hi guys,
    It's been a while since I last posted a question of my own here, but I'm at my wits end. As I may have mentioned, I live in France, and my ISP is Free (no, not free, Free...). I've got what they call a "box" here, i.e. a sort of super-modem that will let you connect to the Internet via xDSL (and soon VDSL2), receive hundreds of TV channels, read BluRay discs, store files (videos, music, photos, what have you) on a integrated NAS, place and receive phone calls, whether via a landline (DECT) or, since recently, through a femtocell.
    All in all, the package is impressive and works flawlessly. But...
    (Of course, there had to be a "but)
    ... Yesterday, I let my "box" (it's called a Freebox Revolution, or Freebox V6--for Version 6--by the way) upgrade its firmware, reboot as it always does in such circumstances, and  since that,  the NAS won't mount in the Finder the way it used to under the Shared left pane.
    Now, every time I reboot my Mac, I have to open a browser windows and type "smb://mafreebox.freebox.fr" in order mount the NAS in the Finder. I've saved the credentials (login, no password) in the keychain, hoping it would help, but it doesn't. I've got a PC running Windows 8.1 Preview at the moment, and created a shortcut to the NAS on the Desktop. Guess what? I double-click on the shortcut, and sure enough, I can access the content of the NAS from Windows, but not from the Mac.
    I must add that I haven't changed anything on the Mac since, or before, upgrading the "box" firmware.
    Any ideas?

    OK, you must think I'm going bananas, but my issue is gone... For now...
    Seriously, what do you guys think about this problem with network drives mounting or not, depending on, I don't know, the weather, maybe?

  • Mounting network drives at startup?

    I know this could be done in 10.4, but I can't figure it out in 10.5. I am wanting to have a couple network drives connect at login and mount to the desktop. Currently I have to go into the shared computers and drives via the finder, then connact as. Is there a way to get these to mount at startup?

    You can also create Automator applications that launch at login. Take a look at this tutorial:
    http://forums.macrumors.com/showthread.php?t=144914
    (the post at 08-20-2005, 10:13 PM has the answer I used)
    Since I have a Storage Area Network, shared drives and a cluster, I have to make sure that each node (computer) can see the shared storage, the cluster controller and the place where the source file for rendering is located. So, instead of worrying about keeping it all configured, I just made a Workgroup, assigned Read/Write privileges for any admin user, turned on Apple Talk, and made a script to mount all the local drives (ComputerName.local) for all computers, except for the local one.
    Since managed, render services can also be flaky, I also wrote a script that resets the services at login (in case the IP changes or what ever).
    It works like a charm, and better yet, I can see it running at login.
    Cheers,
    Jeff W.

  • Mounting Network Drives Without Windows Opening

    I have 3-4 Networked drives that automount for my users when they login, but whenever they login it opens up a window for each of the mounted drives.  Any way to prevent this?  I've tried marking "hide" in system preferences for them in login items, but that made no difference. 

    I am trying to run a computer on which to host installers for a schools network. The computer that i have all the installers on is partitioned into 3 parts: a system partition, a partition for the installer programs, and a partition for filemaker serving. I need to be able to connect to the computer through the network and access the installers. I don't want people logging on to access the home directory of the user account that they are using to connect to the install volume. I would really like to be able to tell it when people log on from another spot on the network to just mount the installer partition nothing else. I am aware that os 10 defaultly mounts just the home directory when you access a name on that computer from another local.
    I hope this is enough information.

  • Mounting network drive

    Okay, I am posing this request to figure out how to do the following:
    I have a network drive that I want to use to store my itunes library. I need to mount the drive so that my computer sees it when it boots up and can access the files. I also want to avoid having the computer open a finder window at start up. Can anyone please give me a step by step of how to do this? I am new to Macs so more simple steps would be better.

    Once the drive is mounted and it is showing on your desktop open system preferences-->accounts--> your user account
    click the login items tab
    drag n drop the mounted volume onto the login items window.
    If the network volume requires a user name and password then be sure to add this to your keychain then you wont be prompted to enter the password at login.

  • Mounting network drive failing when launched with "crontab"...

    Greetings!
    Here's my problem:
    I have a cron job (domain user) that launch a perl script.
    Somewhere in the script, I mount a network drive like this: "/sbin/mount_smbfs //user:pw@machine/path"
    I get the following error: mount_smbfs: server connection failed: broken pipe.
    -If I ssh to the mac, manually execute the Perl script, no problem, the drive is mounted and I am happy. But it constantly fails if I am not logged in.
    As a workaround, I tried to make my user automatically logged in when the Mac restart. But what do you know? Not working with my (domain) user. But it works fine with any other local users.
    Any ideas?

    Post to the Unix forum under OS X Technologies.

  • Won't allow me to change my hard drive icon

    Hello anyone! Here's my problem...I've been using Mac since 1985 and this has always been how you did this and now it's not working, has something changed?
    1. Copy icon, picture, photo
    2. Click once on hard drive icon on desktop and choose Get Info
    3. Click on hard drive icon in Get Info window
    4. Paste
    5. Voila!
    The blue halo that usually appears around the icon in the Get Info window is not appearing anymore. I've tried unlocking the Owner and changing from System to me as user and that doesn't help. I've tried renaming the hard drive and no luck. Has anyone else had this issue and can it be resolved. I don't want Cookie Monster as my icon anymore! Thanks!

    There are a number of possible problems:
    1. If you use Preview to copy the pix you might not have actually gotten the picture onto the Clipboard, so there is nothing to paste. You can check this by either "Show Clipboard" from the Finder's Edit menu, or try pasting first onto a new folder. If it doesn't paste into the folder let us know. It could be that you haven't gotten the desired picture "active" in Preview--if, for instance, it is an icns file you need to select the 128x128 icon and then click in the actual picture part of Preview's window, then copy.
    2. If your picture is indeed on the Clipboard and will paste onto a folder, but you can't paste onto the drive because the wee GetInfo icon won't highlight you've got a permissions problem. I've had luck changing the icon by TEMPORARILY giving Everyone read and write permissions to the drive, using GetInfo.
    As a last resort you will have to use the Terminal, there are several different things you can do, of various levels of complexity.
    Francine
    Francine
    Schwieder

  • Mac Mini Mounting Network Drive problems....  weird

    Okay 2 Mac minis. Older G4/1.33/512/40/Combo, 10.4.11 Not as old C2D/1.83/2gb/80/Combo. First one mounts SMB shares from a NAS store no problems.
    2nd one (newer) does SOME of the shares and not others. Will see, connect, mount and place icon on desktop. As soon as I click th icon on desktop or side panel in finder, it clears screen, closes the windows that are that open. Other mounted shares it will open and use. Its the same ones each time that cause the problem.
    Anyone no why? Have checkled all network settings on both machines and there both identical in evy way. Connecting using same user name and password.
    Hellllpppppp

    You could try reinstalling the OS?

Maybe you are looking for

  • HP LaserJet Pro 400 color Printer M451dn won't print

    My HP LaserJet Pro 400 color Printer M451dn stopped printing after a short usage of non hp toner. How do I get this printer to accept these toner cartridge ? My 3600dn never has a problem

  • How to get larger previews in open file dialog

    The title when open images.  They look very small and there's no option to enlarge them as I can in finder windows Thank you

  • Adobe Acrobat 8 Prof - PDFs will not open in Adobe automatically

    I have a workstation that has Adobe Acrobat 8 professional installed. I was first notified that the user complained that each time he opened a PDF in an Email, it would open in Explorer. I had him save a document to his c; drive and did a view file t

  • Reading files from clients machine through a browser

    if i have to access or use some files say C:\hello\myimage.jpg from client machine's local drive, how it can be done using some technology in Java eg applets or some other way. please read the following situation to have a better undertsanding of the

  • Purchase Order Approvals

    Dear All. I would like to know if there is a way to activate approval procedures for Purchase Orders already entered in SAP. The Purchase Order have not gone to the next stage of Goods receipt or AP Invoice. Kind Regards Rajindra Parmar