Adding folder alias to finder Sidebar in Lion with AppleScript

I am creating 2 AppleScripts to automate mounting Windows shared drives on Lion Macbook Airs.  The first creates an alias on the user's desktop to the user's shared drive.  This is functional and doing what I want it to do.
The 2nd script attempts to create a favorite to the alias in Finder's sidebar.  Unfortunately, I can't seem to get this script to work.
I am attempting to create an alias on a user's desktop to a folder in a Windows network share.  Here is my applescript:
set user_name to (short user name of (system info))
tell application "Finder"
  activate
          set myFolder to ((home as text) & "Desktop:" & user_name)
  select myFolder
          tell application "System Events"
  keystroke "t" using command down
          end tell
end tell
The script runs, Finder opens to the user's folder, but nothing is added to the side.
Any help would be very much appreciated!

Nevermind... figured it out.  I needed to open the folder for the command to work, so I added:
open myFolder after the select line.

Similar Messages

  • Cannot remove a broken sidebar network folder alias in Finder window

    Mac OS 10.6.7 -- WinXP Home
    I have a created netowork folder alias in the sidebar of my Finder window that points to a shared folder on an officemate's PC (WinXP Home). This folder has been deleted on the officemate's computer. Now, in my Finder window, I cannot click on the alias. Clicking on the broken network sidebar folder aliases or dragging them off of the side bar (they used to vanish in a puff of smoke but now they don't) does nothing.
    I can right/control-click is but the only option in the sub-menu is "Open Sidebar Preferences..." and nothing else (other aliases have all the options including "Remove from sidebar"). I can't even drag the folder aliases off of the sidebar in a puff of smoke either. I'm at a loss on this one.
    Any ideas how to remove these broken sidebar aliases? Even opening the sidebar preference panel yielded nothing I could see that would help.

    If you have installed Developer Tools on your Mac (Optional Installs on your MacOS X installer DVD) then you can delete individual aliases in the Finder sidebar, using Property List Editor, which you'll find in Developer > Applications > Utilities.
    In your Home folder go to User > Library > Preferences > com.apple.sidebarlists.plist
    Control-right click and choose Open With > Property List Editor.
    Scroll down to "useritems" and click the grey arrow next to it to reveal contents.
    Click the arrow next to CustomListItems and you'll see a list of entries marked "Item" with a numeric suffix.
    Click the grey arrow next to the Item whose number corresponds to the sidebar alias that you want to get rid of and you'll see the info associated with that entry, including its name, as seen in the sidebar.
    If it's the right one, click again on the Item header (i.e. "Item [x]") and hit delete.
    Quit Property List Editor and Save changes.
    Quit and relaunch Finder and that item will be gone from the sidebar list. Everything else will still be there, and you won't need to rebuild the list.

  • Finder sidebar not updating with applications open/save dialog boxes

    Hi all,
    I've searched the threads and can't seem to find an answer to this recurring issue that I'm having.
    I save folders to current projects in the Finder sidebar. However, I find that when I try to find those sidebar folders from within the open/save dialog applications that it is often times and old version of the sidebar. In the image linked below note the Finder sidebar on the left and the InDesign CS sidebar on the right. The list of folders is different. The version via InDesign seems to be an older cached version.
    Screen capture: http://www.fabianross.com/forum-images/screen-capture.png
    Does anyone know how to update this cached version to see the new list of folders?
    Thanks,
    Jerry

    Try deleting this file: com.apple.sidebarlists.plist
    /Users/YourName/Library/Preferences. Drag that file from the Preferences folder to the Trash, empty the Trash and reboot. See if that helps...
    Seems to me that Adobe is very picky about where the files are kept on the hard drive. You might not want them in the Sidebar. Whenever you do an Adobe software update, the installer needs the path to where those files go. If it's missing in action, it can wreak havoc.
    Make sure when you do Adobe updates, if there is a link included or a Read Me file, check that out first before installing anything.
    Run Disk Utility and Repair Disk Permissions BEFORE and AFTER any software updates:
    Launch Disk Utility. Select MacintoshHD in the panel on the left, select FirstAid, then click: Repair Disk Permissions. Quit DU when it's finished and reboot.
    Carolyn

  • Adding a country to an address in Addressbook with AppleScript

    Hi,
    I'm stuck on a simple script to add a certain country to every contact that hasn't one in my Address Book.
    This is the code at the core:
    repeat with thisPerson in every person
    repeat with thisAddress in every address of thisPerson
    if (country of thisAddress) is "" then
    set (country of thisAddress) to "My Country"
    end if
    end repeat
    end repeat
    The log however shows a 'missing value' every time I want to get the country of an address. How can I fix this?
    (And how can I format code in this forum?)
    Thank you for any input,
    christian

    The log however shows a 'missing value' every time I want to get the country of an address. How can I fix this?
    That's correct - there is a difference between 'missing value' (no value recorded) and "" (an empty string).
    The solution is simple - check for 'missing value' - rather obscurely, 'missing value' is an AppleScript keyword used just for that purpose:
      if (country of thisAddress) is missing value then
        set country of thisAddress to "My Country"
      end if

  • How to view and or delete smart folder in finder sidebar

    Sounds easy, but I am having a problem. I recently had my hard drive replaced at the genius bar. I have a smart File on the finder side bar that I can not open or delete. When I click on the file I get the message "the volume for (name of file) cannot be found. I tried using both "spotlight" & "the finder go to" locate this smart folder to no avail. I cannot remember when I created this file but I had labeled it appleworks 6 manual.. I don't ever remember using this smart file, I may have just created it without ever putting anything in it. So how do I open it or just plain delete it. I can remove it from the side board but it just comes back. I also went to /volumes which took me to the hard drive, but when I looked at all the files I couldn't find a smart file with this label. Any suggestion? Thanks Paula

    I made another smart folder. I wanted to see if I could get the options with the control key. My test folder worked fine and I was able to get the options. I could delete the test folder without any problems. If it is that I have an Appleworks manual stored in an image file, then how could I find the image file? And if I did find it, what would I do to it, so I could delete this smart folder that I set up? I did a spotlight search for image file, but I couldn't find anything. I also searched appleworks manual and I did find a "getting started with appleworks 6 document" with an path of '/application/appleworks (U.S. English) Applework 6 documentation ... when I click on it it opens in preview.. but that manual is stored in my appleworks in applications, so I don't think it is related to the smart folder in the finder sidebar. If I did manage to close or delete the image file that was related to this folder, does that mean I'm just stick with this smart folder that I can't delete on my finder sidebar?

  • Applications folder inaccessible through finder?

    So I recently downloaded an application that I decided I wanted to delete. However, when I try to go to "Applications" by clicking on it through the Finder sidebar, It shows up blank for a split second and then the window dissapears. When I look in the Applications folder under my name in /Users/, the folder is empty. When I try to "get info" on the folder in my finder sidebar, it is unable to calculate the size. When i search "Applications" in spotlight, there are no results, for both applications and the folder itself. When I try to access my applications by clicking on an application in the dock and selecting "Show in Finder", the window appears and dissapears again. I have tried getting a system update and restrating my computer and finder multiple times, but nothing is working. Also, sometimes my background photo and my dock dissapear and are replaced by a gray background.

    I would try finding and opening Disk Utility and running a permissions repair on the drive in question.
    If you can't find or run Disk Utility, try this if you still have your Mac OS install CD:
    • Insert the disk and Hold c or option key down and tap the power button to boot from the installer disk. Let the installer start, but before actually installing:
    • Select Disk Utility from under the Installer Utilities menu at the top of the screen.
    • Select your drive or partition on the left, click First AId > Repair Disk & Permissions.
    If you are a 10.7+ user - hold command r to boot from Lion Recovery HD partition (only, use no disks), it's a bootable section on the boot drive itself that's like install cd.
    • Select Disk Utility from the menu option.
    • Select the drive or partition on the left, click First Aid > Repair Disk & Permissions.

  • How can I change the order of my sidebar in Lion?

    I prefer to have my devices at the top of my sidebar list in the Finder (as it was in Snow Leopard), rather than my Favorites (All My Files, Airdrop, etc). Is it possible to bring devices back to the top of the ordering system? Thanks!

    Re: Customizing the Finder sidebar in Lion? 
    01/08/2011 2:48 PM (in response to Brian Christopher)
    Hi guys.  The given solution works for drives, but I prefer my computer to be on the very top, here's how...
    Convert the following plist to XML using terminal:
    plutil -convert xml1 ~/Library/Preferences/com.apple.sidebarlists.plist
    Edit the plist:
    open ~/Library/Preferences/com.apple.sidebarlists.plist
    Find in the hierarchy Favorites >> VolumeList and then look for:
    <key>Name</key>
       <string>Computer</string>
    Look immediately below that for the visibility key and change the string from NeverVisible to AlwaysVisible:
    <key>Visibility</key>
       <string>AlwaysVisible</string>
    Close and save
    Convert the plist back to binary:
    plutil -convert binary1 ~/Library/Preferences/com.apple.sidebarlists.plist
    Relaunch the Finder:
    killall Finder
    Tada!  Hold Command and drag the items in the Sidebar to get your computer on top, where it should be.
    Found this possible solution in another thread about the sidebar order.
    https://discussions.apple.com/thread/3200109?start=15&tstart=0
    I haven't had time to try it out and cannot verify that it will work.

  • Accidently removed "applications" from finder sidebar

    I thought it would be a cool idea to drag my applications folder from my finder sidebar into my dock for easy access. But when I tried to drag it in I actually removed it by mistake (I got the poof of smoke.) How can I get it back? I tried to edit-undo, but it won't let me. Thanks.

    Nevermind I figured it out. I used spotlight and then dragged the folder back in. Thanks anyway

  • Finder sidebar, standard dock folders (Applications, Documents and Downloads) and home folder in English (Lion and also Snow Leopard)!

    A few days before I downloaded Lion, the names of the finder sidebar, the standard dock folders and my home folder changed from German to English. What can I do to change back to German?

    Well I am surprised by your answer. I thought that if you had used it, maybe something of the settings was left behind after uninstalling it.
    I do not think it will solve your issue, but try it, you will never know....

  • Dock folder alias's & "Open in Finder" open address book app

    Hello all,
    My Issue:
    It would appear that any "alias" and "Open in Finder" calls to open a "folder",  have instead been redirected to open "Addressbook.app".
    When did it start?
    After trying to figure out how to import my iPhone contacts into the "Address Book" on my "MacBook Pro". DETAILS:  iTunes and multiple 3rd party apps cannot see the "contact group" on my iPhone (that contains my 250 contacts). Many hours of experimentation/troubleshooting of the iPhone address book issue, appears to have inadvertently caused the current issue.
    The Details:
    1)  With any folders( Documents, Downloads or any others ) placed on the dock:  If I select "Open in Finder" the "AddressBook" app is launched & displays a Dialog box with this message: "No cards added.  No importable cards were found.". 
    2) Any "folder" alias created and placed on the Dock does the same thing( as item 1 above ): When the alias is clicked, the "AddressBook" app is launched & displays a Dialog box with this message: "No cards added.  No importable cards were found.".  
    My Troubleshooting:
    1) If I move the AddressBook app from the  "Applications" folder to the "Desktop" folder then the following system dialog box message is displayed:
    "You are opening the application 'AddressBook.app' for the first time. Are you sure you want to open this application?". It also notes that "Addressbook.app" is now located in the "Desktop" folder and, if I then choose "OK", (there after) the same issue as previously described in items 1 and 2 above occurs.
    2) Same exact problem( with a different app ) is described in this post but, nothing here fixed my issue :  https://discussions.apple.com/thread/1746309?start=15&tstart=0
    There's probably any easy fix to this that I've overlooked( seems related to "system file associations", etc) but, I'm hoping the forum members will set me straight quicker then I can stumble on the solution.
    Thanks in advance to any respondants.

    Yep, I completed all the recommendations in the post I referenced. Getting Baltwo involved is a good suggestion. I rarely post so, not sure how to do that.
    I'll research and dig around the system files some more. It must be buried in there somewhere. It seems obvious that a Dock or related system setting  ( that should point to Finder when opening a Folder )  has been changed to point to the Addressbook app instead.  It's like a bad alias( or Windows short-cut ) pointing to the wrong thing, except it's a system setting problem ( with regards to it being a normal function of the Dock and not something a user creates, like an alias ).
    One important clue:  If I put Addressbook.app in the trash, everything works fine.  Maybe I'll leave it in the trash and try to reinstall it from the Snow Leopard CD. 
    I checked out your iPhone link for the other issue that lead to all this.  Unfortunately, I already went through that scenario with no success in getting my 250 contatcts into my Macbook Pro address book. The gist of that issue is all my iPhone contacts are in a group that iTunes(etc) can't see. One thing I did was recreate my contatcts group in Addressbook.app so it showed up in iTunes sync settings. Checked it, synced my phone and still didn't work. Did a bunch of other stuff too, also to no avail.
    Thanks for your efforts Bruce, I appreciate it.

  • I have added the Documents folder to the Dock, however when I save a document it doesn't appear in the Documents folder on the Dock, only the Documents folder in the Finder.  Is this a quirk, so am I doing something wrong?

    I like having my Documents folder on the Dock so I added the Documents folder from the Finder to the Dock.  When I save a document to the Documents folder, the saved document appears in the Documents folder from the Finder and not in the Documents folder on the Dock.  Why is this happening?  And how can I change this?

    newbieAK wrote:
    I opened the Finder, selected Documents, then right clicked and selected Add to Dock.
    Oooh. I never new that was there.

  • How to hide or rename the HP Printer's Mac address from Lion Finder Sidebar

    I have an HP d100a all in one printer, and since upgrading to OSX 10.7 (Lion), my printer's mac address shows up in the Finder Sidebar under Shared devices. I understand this is for the printers SD card slot to be shared over my network, however the name is not user friendly.
    Is there a way to rename what is displayed in the Finder window, from the devices mac address to a friendlier name?
    If not, is there a way to disable the sharing of the SD card slot so it is hidden from the sidebar completely?
    I have found several posts from people not knowing what this entry is, but I have not managed to find any posts that explain how to rename or hide the entry.
    Any help would be greatly appreciated. 

    I have also registered to this forum to inform that the problem with showing the MAC-address in the sidebar of the finder is still not solved.
    The strange thing is that the Embedded Web Server says:
    "This specifies the Bonjour domain name assigned to the device, in the form <host name>.local. If a user-specified host name has not been assigned, the default host name HPxxxxxx is used, where xxxxxx are the last 6 digits of the LAN hardware (MAC) address. This option cannot be modified."
    But I did assign a user-specified host name and that name does show-up everywere (also within Bonjour), except in the sidebar of the finder (hp###xx##x####). Lots of people have the same issue, when searching on the interet, but not one has found the solution.
    Please help with solving this issues?

  • Faint Lines in Lion Finder Sidebar

    After upgrading to Lion (10.7.1), I noticed faint horizontal alternating lines in the Finder sidebar when viewed at high or low vertical angles, as well as any other application that uses the same color blue in its active sidebar. This occurs on my Macbook Pro 17 inch, mid 2010, matte display (see attached screenshot). On my Mac Pro (2007) running Lion 10.7.1, the Finder sidebar appears as a smooth gradient.
    Taking a screenshot and sampling the gradient colors in Photoshop indicates the lines are there on the Macbook Pro, but on the Mac Pro the blue is a smooth gradient.
    Does anyone else experience this behavior?

    Go to /Users/yourname/Library/Preferences and trash these two files:
    *(Note that to get to Library you must go to your "Go" menu holding option key)
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then, restart.(You will have to reset a few finder prefs the way you like them.)

  • Lion finder sidebar loses devices, places, icons

    Lion finder sidebar loses devices, places, icons. Preferences marked to show everything. Only Macintosh HD appears in sidebar.

    Go to /Users/yourname/Library/Preferences and trash these two files:
    *(Note that to get to Library you must go to your "Go" menu holding option key)
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then, restart.(You will have to reset a few finder prefs the way you like them.)

  • How do I remove a broken alias in my Finder Sidebar without Apple Developer Tools loaded?

    OS 10.7.5
    I have a broken/dead alias in my Finder Sidebar.  It will not activate when the cursor is on it therefore I can't move or remove it from the Finder Sidebar.  I found a previous solution that requires loading the Apple Developer Tools in order to acces and edit the list of alias.  Is there any other method that can be used to remove a broken/dead alias available?
    Thanks.
    Charlie

    Never mind!!  Even though the alias would not highlight to show that it was active, I simply Command > drag and it disappeared.
    Charlie

Maybe you are looking for

  • How to disable parent window while popup window is coming

    Hi, I am working on Oracle Applications 11i. I am able to get the popup window using the Java script in the controller. Please see the below code for the reference. String pubOrderId = pageContext.getParameter("orderId"); StringBuffer l_buffer = new

  • Safari popups that won't go away

    I think that I accidentally clicked something I shouldn't have and now I had all these popups going on and I keep "okay"-ing them but they just keep popping up again and I don't know what to do. I've already restarted my computer, but every time I op

  • Blurred Text in Safari

    Occasionally when reading a ducument in Safari, the text blurs and I have to reboot Safari. Anyone else have this problem? Virg

  • I upgraded to Lion a month ago and am trying to start Mail, but it's been "upgrading my database" for a month

    the "upgrading database" phase which should "take a couple of minutes" has taken over a month and it's still only a quarter of the way done. i'm on a macbook pro that is just under a year and a half old. this is the screen i'm on / have been on: what

  • Firefox crashes because of msvcrt

    Title... This seems to be a rather widespread error though, if you look at the statistics: https://crash-stats.mozilla.com/products/Firefox The crash appears when closing Firefox. I already tried to uninstall Visual Studio but that changed nothing. /