Adding items to the sidebar automatically - is there a better way?

I'm working on a way to automatically add a user's network home to the sidebar when they log in.
Currently, I've removed the local home from the sidebar in the user template, and the following runs at every login to check whether it is there and add if not:
(ignore the http link in line 2, forum doesn't like my code)
name="$(whoami)"
if [[ "$(defaults read com.apple.sidebarlists)" =~ "$name" ]]
then echo "true"
else
open /Volumes/MacHomes/$(whoami)
osascript -e 'tell application "System Events" to keystroke "t" using command down'
osascript -e 'tell application "System Events" to keystroke "w" using command down'
Which does the job, but I don't like the way that it has to open the folder in the GUI and can therefore be interrupted by an ill-timed click of the mouse. If possible, I'd prefer to run this without any visible element to the user. I'm also bothered by echoing a string that doesn't seem to go anywhere - to verify a condition and invoke else if necessary.
Can anyone offer any suggestions on how to improve this?
thanks
Chris
Message was edited by: Christopher Mills2

Tony,
Yes, but no!
The client's need is for an AFP based, per user, private storage area without using the functionality provided by OD but retaining the ability to manage with MCX - so it's a network home in all but name. Life is too short to waste my time explaining the politics... I will write it up and stick it on t'web when the project is done.
Essentially I have a collection of shell scripts that run at log in on the client. This part comprises a fairly minor piece that I would like to be a little more reliable and less intrusive to users in operation.
Chris

Similar Messages

  • Switching a panel to another panel in the same frame.Is there a better way?

        public void actionPerformed(ActionEvent e) {
            if (e.getSource() instanceof toolButton){
                westPanel.remove(optionPanel);
                westPanel.setVisible(false);
                toolButton tb = (toolButton)e.getSource();
                optionPanel = tb.getPanel();
                westPanel.add(optionPanel);
                westPanel.setVisible(true);
        }This code above is what I used to execute when one of several JButtons is being pressed.
    In this program, one of the JPanel will be automatically switched to another JPanel when you press the respective JButtons.
    Here are my questions:
    1. Right now, I use westPanel.setVisible(false) and then change some stuff and then invoke westPanel.setVisible(true) to make it visible again. Although this works, I have a feeling that this is not quite right. I feel that there should be some better way to do this, switching the panel and request the program to redraw the replacing JPanel. Is there a better way for this?
    2. Most of the time, the JPanel changes the size according to the components on it. I have tried several LayoutManager, but it seems that those components have more priority. Is there a way to completely fix the JPanel so that they stay the same size?

    Look into using a Card Layout rather than manually swapping the panels: http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html

  • Is there any better way for updating table other than this?

    Hi all, I need to update a row in the table that require me to search for it first (the table will have more than hundred thousands of row). Now, I am using a LOV that will return the primary key of the row and put that primary key to DEFAULT_WHERE property in the block and execute query command to fetch the row that need updating. This works fine except that it require 2-query-trip per update (the lov and the execute_query). Is there any better way to doing this? This update is the main objective for my application and I need to use the most effective way to do it since we need to update many records per hour.

    Thanks Rama, I will try your method. Others, how to query row instead of primary key? I thought that querying primary key is faster due to the index?
    BTW, what people do if you need to update a table using Form? I have been using the LOV then execute query since I first developing form. But I am building a bigger database recently that I start worrying about multiple query trip to dbms.
    FYI my table will have up to million rows on it. Each row will be very active (updated) within 1-2 weeks after it creation. After that it will exist for records purposes only (select only). The active rows are probably less than 1% of all the rows.

  • Have you got a better idea? Is there a better way? ( arrays )

    Hello!
    First post here and ofcourse it is a question I hopo you people don't mind. I will get right to the point:
    I have a picture , or to be precise the pixels of a picture stored as a 3 dimensional array in the form of
    img[y][x][color].
    Since I am working on grayscale the color doesn't matter , so de facto I have a 2dim array of X-Y coordinates. For my programm ( a line tracker of sorts) I need to be able to select a subgroup of this array. This subgroup should be equivalent to a small (appr. 10x20 pixels wide) box in the original picture. My problem is that this box could be at any angle, that is it's side do not have to run parallel to the x-y-Axis.
    Now how would be the best way of doing this?
    My idea is to calculate the lines of the rectangle geometricaly and then try to approximate them onto the array. After that I can use them as boundaries to select every pixel that is inside the box.
    Is there a better way? Does somebody have any experience with something similar?
    Any help would be greatly appreciated...
    Alexis

    Two things to try. Try rebuilding the mailbox. This can take awhile if you have a lot of mail.
    Rebuild mailbox
    Try reindexing the mailbox. This can take awhile if you have a lot of mail.
    Reindex messages

  • I have just updated to Lion and now my folders no longer show number of items on the bottom. Is there a fix for this?

    I have just updated to Lion and now my folders no longer show number of items on the bottom. Is there a fix for this? I allways found that handy. Now I have to click on an icon on the top, This is a backward step if that is now the only way to see the number of items. Am I missing something obvious?

    Parrotcat wrote:
    I have just updated to Lion and now my folders no longer show number of items on the bottom...    
    In the good old days of Snow Leopard, an open Finder folder had a border along the bottom of the window which could show the number of items in that window and the total available space on the hard disk or partition that folder resides on. That bottom border is gone in Lion and those two bits of information are gone with it. Is that what you're talking about? If so, I'd like to learn how to get it back too and "Show Item Info" is not the way.

  • I was adding items with the intent of command z 'ing them back to their original when it crashed, autosaved, and my original numbers were lost to the temp numbers plugged in... how can i get back to the previous version? Because it had closed, command z

    I was adding items with the intent of command z 'ing them back to their original when it crashed, autosaved, and my original numbers were lost to the temp numbers plugged in... how can i get back to the previous version? Because it had closed, command z

    Sorry, this happened in CLOUD numbers....

  • Personalization: Adding Items in the Review Page

    Hi,
    I have successfully added items in the previous page (Employment Type) before the review page. I was able to submit it and see the changes in APPS.
    Right now, whenever I reach the review page and I did some changes with my newly added items, these items are, naturally, not displayed in the Review Page. I thought it will be as simple as creating items in the Review Page (thru Personalization, of course) but I couldn't add the current and proposed value. Couldn't even display the static texts properly in the Review Page.
    So how can I add items in the Review Page?? I tried using the same view attribute and view instance but it didn't give me any value.
    I'm still new with OAF personalization so any recommendations on books to read are welcome.
    Thanks!
    N

    Hi,
    From your description, my understanding is that you want to show the number of unread mails on the home page of SharePoint.
    Here is a solution from codeplex
    for your reference:
    http://exchangewp.codeplex.com/
    You could
    also refer to this article(SharePoint UnRead Email Solution):
    https://pinpoint.microsoft.com/Applications/12884948334?locale=en-ye/writereview&wa=wsignin1.0.
    Best Regards
    Vincent Han
    TechNet Community Support
    Thanks Vincent, That will help me get somewhere.
    Regards,
    Gagandeep Singh
    My CRM blog |
    My SharePoint blog

  • Can i restore the 'recently added' button in the sidebar of iTunes?

    It happend that I accidencially erased the 'Recently Added' button from the sidebar in iTunes which is a bit of a dissaster for me as I often add mp3's from musicproductions elsewere. It makes it quite difficult to find the songs without that button.

    Hi Jimzgoldfinch
    It worked, i have a new smart playlist up and running. That's great, thanks a lot!
    Sam Foh

  • Is There a Better Way to Work in the Marker List Window?

    Is there a better way to sequentially listen to phrases one-by-one in the Marker List window? What I'm doing is Auto-Marking one single long file to break out 271 bits and save each as their own file. It's WAY faster than copying and pasting bits into new files and "saving as" 217 times.
    BUT, after Auto-Marking, I have 300-400 phrases to listen to, deleting the non-keepers as I go, until I'm left with my "keeper" 271 marked phrases. But it's so tedious to move from phrase-to-phase. I have to double-click each one before I can hear it (you can move the cursor with the down-arrow, but it won't actually select the audio). So I have to use the mouse (unless I'm missing something) and double-click each of the hundreds of phrases. Then whenever I delete one (which I'll have to do about a hundred times or more to get rid of bad takes, alternates, etc.), inexplicably the cursor jumps way up the list so you have to scroll back down dozens of files to get to where you were. It took me 35 minutes to do it this last time.
    Contrast that with Reaper's audition/preview functionality (which, ironically, AA has also, but only for files already saved into a folder). Once I had all the files saved into a folder, I QC'd all 217 files in Reaper and MAN what a difference! All I had to do was use the "down" arrow to advance to the next file AND have it play automatically (Audition can do the same thing with the "Open File" feature). It literally took me 5 minutes to check all 217 files that way. If AA could add that kind of functionality to the Marker List window, or if I'm just completely missing something (very possible) I would REALLY be happy.
    Any ideas?
    Thanks again! Happy New Years again!
    Ken

    Wild Duck,
    That doesn't quite do what I need. My end-product is 271 (used to be 116) separate files created from one large file. That large one is made up of WAY more than 271 (the VO actor records different versions of some commands, makes mistakes, etc.).
    So I need the ability to listen to each marker, and then be able to delete it if need be.
    The Playlist makes this impossible in two ways. It only has 2 options for hearing each marker, and neither option allows me to delete that marker after I've heard it. It either plays them all back-to-back without stopping, or it plays each as you click the "Move Down" button. That last one would be great if showed me which marker was playing! But it doesn't, so there is no way for me to know which marker number I just heard, nor can I delete that marker after I hear it.
    Sigh.
    Thanks for the tip though:).
    Ken

  • I have a new computer and want to sync my Iphone and Ipad2 to the new computer, is there an easy way to do this?

    I have a new computer and want to sync my Iphone and Ipad2 to the new computer (PC) instead of the old one, is there an easy way to do this?

    Extract from one of our senior participant.
    Syncing with new computer
    1) Without connecting your iPad to your laptop, start iTunes. Click on Edit. Click on Preferences. Click on Devices. Check the box next to "Prevent your iPod etc. from automatically syncing." Click OK.
    2) Now connect your iPad to your laptop and start iTunes.
    3) When iTunes starts, right click on your iPad under Devices in the left column. Select Transfer purchases etc.
    4) After it finishes transferring all your apps to your new laptop, right click on your iPad and select Backup your iPad.
    5) After it finishes backing up your iPad, right click on your iPad and select Restore etc.
    6) After it finishes restoring, left click on your iPad , then click on the Apps tab on top, and check the box next to Sync Apps, then click on Apply below.
    If everything on your iPad looks good after the sync, go back and click on Edit / Preferences / Devices and UN-check the box next to Prevent your iPod etc. The only other thing you may want to check is if your contacts, bookmarks, etc. are syncing correctly now. If not, go to the Info tab after connecting and make sure you indicate which features you want to sync with what sources.

  • I am having trouble transferring files from an old MacBook (2007) to a MacBook Air over a wireless network.  The connection was interrupted and the time was over 24 hours.  Is there a better way to do this?  I'm using Migration assistant.

    I am having trouble transferring files from an old MacBook (2007) to a MacBook Air over a wireless network.  The connection was interrupted and the time was over 24 hours.  Is there a better way to do this?  I'm using Migration assistant.  The lack of an ethernet port on MacBook air does not help.

    William ..
    Alternative data transfer methods suggested here > OS X: How to migrate data from another Mac using Mavericks

  • When I share a file to YouTube, where does the output file live? I want also to make a DVD. And is this a best practice or is there a better way?

    I want also to make a DVD, but can't see where the .mov files are.
    And is this a best practice or is there a better way to do this, such as with a master file?
    thanks,
    /john

    I would export to a file saved on your drive as h.264, same frame size. Then import that into youtube.
    I have never used FCP X to make a DVD but I assume that it will build the needed vob mpeg 2 source material for the disk.
      I used to use Toast & IDVD. Toast is great.
    To "see" the files created by FCP 10.1.1 for YouTube, rt. (control) click on the Library Icon in your Movies/show package contents/"project"/share.

  • After saving a pdf as Excel workbook the numbers remain text and cannot be used in calculations. Is there a better way to convert into real digital numbers?

    After saving a pdf as Excel workbook the numbers remain text and cannot be used in calculations. Is there a better way to convert into real digital numbers?
    I have tried to convert the pdf to Word instead but same difficulty with numbers: look like numbers but not usable for calculations

    Excel has a 'text to numbers' function, I would use that.
    Convert text to numbers. Microsoft Excel.

  • I have 8000  photos in my iPhoto library.  Many are duplicated in the "Pictures" folder in the Finder.  Is there an easy way to detect and delete duplicates in the "Pictures" folder?

    Anyone know how to detect and delete duplicate photo files that exist in the Pictures folder in the Finder that are also in the iPhoto library?

    There's no way to compare the photos in the library with those outside the library.  However, as long as you're running a "managed" library
    You can import batches of the photos, i.e by folder, into the library.  If the photo is already in the library you will be given this notice:
    Check that checkbox and clik on the Don't Import button.  When that folder is finished importing (or not) delete it and go to the next.
    If you need to check for duplicates in the library you can use one of these applications to identify and remove duplicate photos from an iPhoto Library:
    iPhoto Library Manager - $29.95
    Duplicate Cleaner for iPhoto - free
    Duplicate Annihilator - $7.95 - only app able to detect duplicate thumbnail files or faces files when an iPhoto 8 or earlier library has been imported into another.
    PhotoSweeper - $9.95 - This app can search by comparing the image's bitmaps or histograms thus finding duplicates with different file names and dates.
    DeCloner - $19.95 - can find dupicates in iPhoto Libraries or in folders on the HD.
    OT

  • At work we have many who travel with train alot, where the internet is very unstable at best. And  they have trouble getting their e-mails. So the question is if there is a way to increase the mail cache in iOS 7, to lower the dependence of internet.

    At work we have many who travel with train alot, where the internet is very unstable at best. And  they have trouble getting their e-mails.
    So the question is if there is a way to increase the mail cache in iOS 7, to lower the dependency of a very poor internet connection.

    I don't think so. Unless it's in the settings, there's not much that can be done.
    are they using wifi on the train? If so, maybe switching to cellular. There are devices like the Mifi, which is a battery operated portable wifi hotspot that they can connect their device to.
    If the wifi on the train is solid, I know I've had issues using certain hotspots. For example, my yahoo mail simply will not pull down via the mail app if I'm on some AT&T hot spots. But if I go in via safari then it works. So if the signal is good, maybe using a different way can help.
    Or maybe looking for a mail interface that isn't apple's. There are others in the app store that may have better function or more control.

Maybe you are looking for