Script for quitting an application when switching users?

Is there any way to create an applescript that will quit iTunes for me when I switch users?
I have my computer set up with two users, one for work and one for "play". I use iTunes in both users and they both use the same library. Because of this, iTunes cannot be open and functioning on both users at the same time. Since I regularly switch between the two (perhaps more than I should), I need to quit iTunes to use it in the other user. However, I often forget and have to switch back to the previous user in order to quit the program... which is pretty annoying.

Hm, you can trigger script's on login & logout, but it does not seem to be possible to do this on a fast-user-switch....
So trigger the fast-user-switch itself and quit iTunes within this process:
tell application "iTunes" to quit
do shell script "'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspend"

Similar Messages

  • How to correct or fix slow imac on start up or when switching user.  Blue Screen will stay on for 3-5 minutes.

    How do I fix a slow imac on start up and when switching user?  The blue screen will stay on for 3-5 minutes.
    Thanks

    How much free space do you have on your hard disk? And have you ever performed a backup & clean install after an OS X upgrade?

  • Scripts for changing the address of the user when they have been in the box for 6 months

    Scripts for changing the address of the user when they have been in the box for 6 months
    If users are in a folder for deactivated users and disabled users in Active Directory, and been there for 6 moths do: change email address in exchange to existing email address.old 
    Anyone have suggestions on how I can go about it?

    What is this "box"?  What is this "folder" you're asking about?  You'll likely get a better answer if you use standard terminology.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • 'Interference' when switching users

    I recently encountered this problem where, when switching users, the screen looks like TV interference for a split second instead of the cube effect. It doesn't always happen, just sporadically. After looking on the forum and contacting the helpline chat with the support team, the iMac was taken in and a new logic board fitted.
    Upon returning home I discovered that it stills happens, still sporadically but it happens. This would seem to eliminate the fact that it could have been the start of the leaking capacitors as this is a brand new board ( I did check that it was different from the last one ).
    I have also read on here that it could be a software issue in Tiger, as with others I don't recall it happening with Panther, but my mind might be playing tricks ?!?!
    Has anyone come across this, gone through the same solution process, and still have the issue ? Have you come across a solution ?
    Many thanks.

    Just to be clear, I installed the 2GB of RAM the day that I bought my iMac and neveer saw the problem until just before my midplane failed. Given all the info about the industry-wide capacitor problem, I seriously doubt that the RAM is related to any of this, including the interference.
    The midplane issue involves failing capacitors which could affect many parts of the midplane, including the video. The failing caps might be related to the video issue. All I know for sure is that I saw the scattered picture, then my midpplane went. After it was replaced, I didn't see it for a while, but it did eventually return with no other symptoms, so my assumption is that it is unrelated.

  • Have to reconnect to airport when switching users

    Recently I set up my HP printer to print via wireless rather than USB connection.
    Ever since then, if users are switched, or if the computer is waking for sleep, I have to reselect my airport network from the menu.
    Under "Network" system preferences, under "Network Port Configurations," Airport is at the top of the list and is the only connection with a checkmark.
    In the same preference pane, under "Airport", I have the following 2 options selected:
    --Automatically join an open network
    --Remember any network this computer has joined
    Any ideas how to fix this? Basically just an annoyance at this point--it's not like it drops while you are using it.
    G4 933 mhz Quicksilver   Mac OS X (10.4.7)   Wacom Intuos 2 tablet; Epson 2400 Photo; HP Deskjet 6840; LaCie 80gb D2 FWDV

    Similar issue here - just tried it and i went into the PPPoE options and in there I had " Disconnect when user logs out" and "Disconnect when switching user accounts" checked - Unchecked both of those - hit apply and so far looks good.

  • T60 Trackpoint Scroll Disfunctional when Switch User

    I've been experiencing the issue where if a single user is logged into XP, the trackpoint scroll feature works flawlessly, BUT, if you use the XP switch user function and have 2 people logged in at the same time, the trackpoint scroll feature breaks down and doesn't work right.
    This is what I've found (short of re-booting the system): User1 logged on --> Switch User to User2, the scroll feature will work, BUT if you Switch User back to User1 the trackpoint scroll doesn't work anymore   So, to get it to work right for User1 again, Switch User back to User2 and Logoff --> Log back in with User1 and should work again.
    I've done all the driver uninstall/re-install excercises and have tried the native synaptic drivers too....  This just seems to be the way this works (unfortunately).
    Ironically, my old T30 had seemingly the same hardware, but I never had this problem with it... it was seemless when Switching Users.  Funny, I bought a ThinkPad T because I love the trackpoint... I wish they would get it to work right 
    So, anyone else experience this?  Any fixes? 

    Hi,
    If you are using WAD, u have options "Number of data rows displayed at once" and "Number of data columns displayed at once" in the web item properties of the Table web item. There you can specify the count u want. This will surely get u the needed output wherein u can just scroll down/up/right/left according to ur convinience.
    Assign points if this helps u...
    Regards,
    Koundinya Karanam.

  • Removing App-V Applications when the User/Machine is no longer a member of part of an AD group

    Hi All,
    We currently use SCCM 2012 R2 Applications (not Packages) to deploy App-V application to users.  We use AD Security Groups for users who are to receive the relevant App-V apps.
    However what I am getting stuck on is the removal of the application when the user is no longer a member of the security group.
    I have followed the details in the blog listed below, however I running into a major issue when testing:
    http://blogs.technet.com/b/configmgrdogs/archive/2014/11/03/managing-app-v-deployments-in-configmgr-2012.aspx
    Whilst for the main part it works, the main issue is that if another user of the same application logs into the original users' machine, the app gets pulled down again. When the original
    user logs back in, although they will have no capability to launch the application (as no icons appear to be presented to the original user), the app will be back in the cache.  No
    good if a 3rd party licensing tool is producing licensing reports are based on the app existing within the client cache.
    The point/question I am trying to get to.............. is it possible to have the uninstall application (not package) deployment re-run everytime the SCCM client polls so that re-installed applications via A N Other user are removed again based on the
    above scenario?
    Cheers
    Andy

    Andy,
    Try out the following http://sccmentor.wordpress.com/2013/11/15/creating-a-user-collection-based-on-users-not-in-a-ad-user-group/
    Select SMS_R_USER.ResourceID,SMS_R_USER.ResourceType,SMS_R_USER.Name,SMS_R_USER.UniqueUserName,SMS_R_USER.WindowsNTDomain  from SMS_R_User where SMS_R_User.ResourceID not in (select SMS_R_USER.ResourceID from SMS_R_User where SMS_R_User.UserGroupName
    like “<Domain>\\<AD Group>”)
    This just checks AD membership and unpublishes if not a member of the AD group. It's not the nicest of methods as will run for every user if not a member of the group - but may get round your issue.
    Cheers
    Paul | sccmentor.wordpress.com

  • System reboots when switching users.

    I have looked through the boards and can't find reference to this problem.
    When switching users in Windows XP Pro SP2, from a power user to my admin acct. the sys will reboot after core center loads. The other users are not looged off of XP by way of fast user switching.
    If other users log on while the admin acct. is still active, no problem and I can also log back into the admin acct. w no problem.
    Additionally when logging in to a non-admin acct. the following error messages appear.
    Hadrware Monitor  failed to load Drive 1 .... Invalid  handle
    (Core Center) No hardware Monitor .... Invalid handle
    (VBIOS) FLASH_MMIO_MAP DeviceIOControl Error.
    If the items are not connected please piont me to the proper forum.

    First late me comment on what a great library this forum has. It would seem that most issues are covered and often repeated. Some time may be involved to find a solution, but hard work is it's own reward.
    Looking through the threads I've seen several referencves to doing a clean install after installing a new MOBO. I have not done this yet. So I have prepared a slipstreamed Win XP SP2 CD (as suggested in the threads). Before I continue I have to ask for a few suggestions.  
    First-- I will be removing all attached components and periphials (video,sound and externals) withe the exception of the mouse and keyboard. I will set the bios to boot from the CD. So what I would like to know is if my HD config is acceptable and is there a preferred order to connect other devices after install and all updates?
    The 20 gig HD has been reformatted (NTFS) in 2 partitions, Zdrive is 1500mb for swap/page file(as per forum). This drive wasn't doing anything on my sys anyway. I only used it to try linux and I didn't have the patience to figure it out.
    After all drivers are installed is it possible to use the programs installed on the old drive, or should the be re-installed also. I can save all important data if this must be done (ie. saved games, documents, photos etc.).
    Last this is a shared machine w/teens. I have been through a lot to eliminate and protect my self from adware/ spyware and will continue to do so. I would like to keep the user profiles (Power Users) so that games and other software can be used without needing the admin password. This may be off topic but any suggestions would be helpful.

  • Forced to Close all open applications when switching between users.

    I recently purchased a MacBook Pro 13 inch, and have 2 accounts set up on the computer.
    When switching between users on the computer, I am always forced to close all open applications on the current user, in order to switch to another user.
    I was wondering if there was ANY way to keep the pages (specifically Safari) open when switching to another user, so that I can go back to them when I log back in to the other account.
    thanks for the help!

    Enjoy!
    http://docs.info.apple.com/article.html?path=Mac/10.5/en/8672.html

  • Why does the screen background picture get reset to default when switching user

    iMac with OS X 10.6.8
    I have several user accounts on this iMac, each with a different wallpaper chosen from a common folder (library/desktop/nature) in the top level of the hard drive. (Which exists – can always reset background picture from this folder)
    When I switch from one user account to another, the wallpaper picture, set on the previous login,  appears for a moment and then is  immediately replaced by the default blue.
    This happens when switching from any user to another. I tried restarting the system but the problem is still there.
    This problem just suddenly started and there have been no upgrades or changes to OS X.
    Ideas appreciated!!

    I've found the answer.
    Today, the problem suddenly appeared on my other Mac, which made me look at recent apps..
    I installed Team Viewer a month ago, (which is a great app apart from this) so quit it and removed it from the dock. Problem solved!!
    The odd thing is that the problem appeared only after I had been using Team Viewer for some weeks.

  • Popup printing message when switching users

    I'm giving my old Air to my brother, so I set up a new account for him.  When I log in to the new account, I get the following message:
    Failed to listen for incoming Popup Jobs. You will not be able to use Popup printing for the duration of this session. Please report this incident to a system administrator
    It appears in a small window.  Every few seconds, an identical window will come up; by a minute, the screen is filled with them!
    A bit of Googling indicated I should remove Pharos software.  I tried that--I looked in the appropriate library folder--and nothing was there.  Also, this problem didn't exist on my old account.  (Pharos doesn't show up in my login items either.)
    Weirder still, if I restart the computer and choose my brother's account at the login screen, it opens error-free.  But then, if I switch back to MY account without restarting, I get the same pop-ups!
    It's a pain to have to restart to switch users.  Someone please help! 

    Ok, so it turned out it was Pharos.  At first, when I did what the post below said, I could not find the uninstaller.  It turns out it's a hidden file.  Tech support told me to open Finder, press cmd+shift+g, type /Library/Application Support/Pharos/Utilities and press enter.
    This way, I did find the uninstaller.  I ran it, uninstalling both components, and afterwards everything is fine.
    https://discussions.apple.com/thread/1204540?start=0&tstart=0

  • G5 dual/1.8GHZ slow when switching users and starting mail, opening files

    I have 20' imac dual cpu G5/1.8ghz/1gig/250gig drive with 10.4.11.
    It is much slower than the G5 it replaced. Symptoms include: very slow when switching to another user desk tops, opening up the hard drive for the first time once you get there, opening entourage or mail for the first time; lots of beach balls.
    The drive has more than half the space left, we don't have many applications running, our iphoto and itunes libraries are under 20 gig combined. I ran the disk utility and cleaned up permissions. We typically leave the mac on all the time but restart occasionally.
    Any ideas?

    We'll let you in because you used to have a G5 iMac , but you really should post on the dual page. Anyway, have you cleaned your caches in the browser you use? You can use OnyX to clean all the caches. Make sure you empty the trash in all your user accounts as well. Try resetting the PRAM too.
    Hope some of this helps,

  • Mounted Network Drives dismount when switching users

    I have a local ReadyNAS with multiple shares running AFP, and am using Bonjour Mounter to automatically attach to the shares when they are available (i.e. - when I boot up on my home network from my laptop).  Under Lion, everything worked well - when I switched accounts on the laptop to another user, the mounts remained avaialble, even if they were inacssessable to the new user on the Mac - when I swapped back to the first user account, the mounted shares were still there.
    Since upgrading to Mountatin Lion, I've noticed that when I switch accounts on my Mac to another user, the Mac seems to dismount the shares, making them unavailable.  This means that when I switch back to the original user profile on my Mac, the drives need to be manually re-mounted (since Bonjour Mounter doesn't see them as "new" and pick them up automatically).  This is annoying when I am hopping between multiple accounts on my Mac - is there a way to prevent the dismounting behavior when switching accounts?
    Bonjour Mounter has not been updated in some time, so I am fairly certain it is not the cause of the issue.  The behavior started with Mountain Lion 10.8.0, and is persisting in 10.8.1
    Thank you!

    Hi Geoffrey,
    This won't be much help, but I'm having the exact same issue. I'm mounting AFP shares from a ReadyNAS, but I'm not using Bonjour Mounter. And this happens whether I script the volumes to mount, or if I mount them manually. For whatever reason, they dismount when I switch users, lock the screen, etc.
    Have you tried mounting non-ReadyNAS volumes to see if the same issue occurs?  I'm curious.
    Hope someone replies that can help. :-)

  • Monitor settings lost when switching user accounts.

    Hi! I just recently noticed that every time i switch user accounts, my monitor settings get corrupted.
    There are 2 user accounts in my ibook. One account is used for work while the other one is used for home purposes. The work account has a specific monitor setting which is calibrated to our workstations. The other account has default settings on it.
    My question is that when I switch users, the settings for my work account gets corrupted. I also can't change the settings without having to restart the book.
    I already repaired permissions and zapped the pram. The same thing still happens.
    Thanks in advance!

    Hello Chuck!
    I've had this problem too. Like you, I managed to navigate to do a restart, but nothing else would make the mouse cursor reappear.
    Bruce, I wasn't using Biggy, PinPoint or any of the other mouse visibility things, simply the magnification provided by System Preferences.
    I put it down to a fault on 10.4.4—a very buggy release— and haven't yet been able to reproduce it on 10.4.5.
    I suggest you send a fault report to Apple ([email protected]), explaining all the circumstances. Try always undoing the cursor zoom before switching users (yes, that's a pain too!!!). And if I manage to reproduce the problem, I promise I'll send in a fault report too!
    HTH
    Archie

  • Airport disconnect when switching users

    I recently changed the password for my airport in an attempt to connect my son's new PSP to my network. (I needed a longer password to mimic a PC network.) After deciding I couldn't make it work I decided to go back to my old basestation password. Nothing was changed but the password using the airport utility program. After doing so I find my airport disconnects when fast switching users. It reconnects fine if I choose it as my network but I need to manually reconnect each time I switch from one user to another. It does it with my new Macbook as well. I've tried every setting I can find using the utility. I've reset my basestation and set it up as a new network. I used to be able to stay connected for days and now it drops whenever I switch users. I've already heard I may need to upload my basestation software again but haven't done so yet (I need to find it first) Any ideas would be greatly appreciated.
    G4 + Macbook   Mac OS X (10.4.8)  
    G4 + Macbook   Mac OS X (10.4.8)  

    Thanks for responding... I've done that more than once. I reloaded the latest AP software and now have it so that I only need to connect one time when my G4 and Macbook are powered up for the day. They stay logged on throughout several fast user switches. I can live with this although my computers used to find the network by themselves each day when first powered up. I've decided I can live with it. Thanks again.
    Mirror door G4 + Macbook   Mac OS X (10.4.8)  

Maybe you are looking for

  • Why does File Explorer Seem to Wait for End-to-End Confirmation?

    For quite a few versions now, when copying large blocks of files from place to place it seems like Explorer adds an arbitrary delay or maybe waits for confirmation internally that every file has been actually written to the disk before continuing. On

  • PCK loopback configuration in NW04s

    Hello, my company has a few PCK installations on Unix and Linux machines (NW04s). I am trying to create a loopback scenario. By loopback I mean that the PCK works without an integration server and it sends the messages to itself. I use file sender an

  • Updating a Deployed J2EE Application Component

    Hi All, I was going through this link below : http://e-docs.bea.com/wls/docs61/adminguide/utils.html#1139180 Updating a Deployed J2EE Application To update a specific component, enter the following commands: % java weblogic.deploy -port 7001 -host lo

  • Time Machine restore from WD my book live duo

    Dear all and especially anyone out there who may be able to help me. I have a MacBook Pro with Mountain Lion, a WD mybook live duo 3/6tb on the LAN, all wired. It has been backing up through Time Machine fine until my MacBook crashed earlier this wee

  • OMBPlus example to bind package function to premapping_process operator

    Does anyone have a script snippet showing how to bind a function within a package to a premapping_process operator ? I got this far before the script ref let me down : OMBALTER MAPPING 'MY_MAP' \ ADD PREMAPPING_PROCESS OPERATOR 'FACT_TRANS_PMO' \ BOU