AppleScript - serious issue with "current playlist"

Hi,
As I'm looking for weeks an elegant way to generate a Genius playlist from AppleScript although this option hasn't been built in (...), I finally found a workaround that clik on Genius button. However, this button's number (ID) change whether the displayed playlist is the Genius playlist or not. For this reason I tried to set two options in my script, laying on the ability to know whether the displayed playlist is the Genius one, thanks to "current playlist".
tell application "iTunes"
          if (name of current playlist) is "Genius" then
                    tell application "System Events"
  click button 12 of window "iTunes" of application process "iTunes"
                    end tell
          else
                    tell application "System Events"
  click button 10 of window "iTunes" of application process "iTunes"
                    end tell
          end if
end tell
However the "current playlist" seems like return to the playlist in which is the currently playing track, instead of the currently *targeted* track (as dictionary pretends)...
After many tests, it looks like it's the only reason why this script doesn't completely work.
Do you have any idea about how tell the targeted playlist?
Thanks for help!
Ben

Hi again,
Here the result of your script run on Lion:
{application process "iTunes" of application "System Events", {minimum value:missing value, orientation:missing value, position:{0, 0}, class:window, role description:"fenêtre standard", accessibility description:missing value, focused:false, title:"iTunes", size:{1440, 900}, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:"AXWindow", entire contents:{}, subrole:"AXStandardWindow", selected:missing value, name:"iTunes", description:"fenêtre standard"}, {button 12 of window "iTunes" of application process "iTunes" of application "System Events"}}
It looks to me that Lion has a strange way to deal with fullscreen windows...
Moreover, it reminded me that I succeeded few days ago in generating Genius playlist while iTunes was in fullscreen mode (but not systemacilly) thanks to the line "telle "iTunes" to activate".
So, here is an update of your first script:
tell application "iTunes"
  name of (first window whose its class is browser window or its class is playlist window)
end tell
tell application "System Events" to tell window (the result) of process "iTunes"
          tell application "iTunes"
  activate
  play -- seems like script doesn't work in some cases if iTunes is not playing
          end tell
          click (first button whose value of attribute "AXDescription" is "Genius")
end tell
I tried every situation I can remember that didn't work before and now it seems to be completely funtional. So
thanks again! But I stay in touch in case you're curious about the result you asked me to post.

Similar Messages

  • Serious Issues with FCPX. Advice?

    I am having serious issues with Final Cut Pro X. I can only edit for about 10 or 15 minutes before all clips in my Timeline and my Event Browser start appearing as either green or black w/ unexplained artifacts in the viewer.
    Once this starts happening in Final Cut, my entire system is affected. Images in Aperture, iPhoto, Quicklook, etc begin to appear as just jumbled artifacts. Even my desktop goes wonky. I took a picture of my desktop with my phone just to provide an example.
    Quitting Final Cut has no affect on resolving the issue. However, completely shutting down my system and restarting does correct the problem. I would think it is a graphics card issue, except for the fact that it only starts happening when I’m using Final Cut. I can watch HD movies, play graphics intensive games, edit in Photoshop, encode video in MPEG Streamclip and so forth and there are no issues until I start using Final Cut again. Also I have run the Apple provided diagnostic tools and TechTool Pro, both of which report no problems with my video card.
    I have tried using optimize and proxy media in Final Cut, but that does not improve the situation.
    I am currently at a complete loss. Any help or suggestions would be greatly appreciated.

    Sound advice. However, I have already taken my iMac to the Apple Store. While there, the issue did not occur and they said that it passed their hardware tests. They said they could replace the logic board and gpu, but since they were not able to diagnose the problem they couldn't say for sure that would fix anything. Since I am no longer under AppleCare, I wanted to look for other solutions before trying an expensive and uncertain fix.

  • I am having some serious issues with firefox, i can't print anything because it is stuck on fax and I can't use any of the drop down menus on any site

    I am having some serious issues with firefox to the point of choosing another search engine. I can't print anything because it is stuck on fax and won't let me change it to my printer when i do try to select my printer it jumps right back to fax. The drop down menus do not work on any of the sites I go to. For example when purchasing clothes and you have to choose a size from a drop down menu I can't do it when I click on the drop down menu it doesn't work at all. I don't have a virus I ran my virus protector and no viruses are present. I don't have any suspicious issues going on with my computer so there has to be something in Firefox that is causing my issues. I tried internet explorer and I don't have any issues there. I hope you can help me because I love Firefox and would really like to continue to use it.

    Lots of issues there, main one getting fcpx going again, try deleting the preferences using the utility deveoped by these guys.
    http://www.digitalrebellion.com
    Try deleting your render files and re-rendering the project.
    Start with these and let us know how you go.
    Tony

  • Serious issue with Mac OS X 10.6.4 and wireless networking

    Hello there, I'm having a serious issue with my TP-Link WP-8910G wireless router and Mac OS X 10.6.4 .
    Problems began some days ago. In short, after a certain period of time, my router drops the wireless connection out and, when I try to re-establish it, if a very short period of time has passed after disconnection Airport detects the wireless network and returns "connection timeout". If I wait more, no wireless connection is detected, and I have to reset the router and re-connect Airport. This is very annoying.
    How can I solve this issue?

    Have you verified that the router is not the problem?

  • HELP: SERIOUS ISSUES WITH BILLING

    I have had serious issues with BT since joining their service. Without getting into the issues we had with the BT homehub and other things at the start of the contract with them here is what's been happening. 
    When we joined BT we explained that we wanted a monthly direct debit. Sounds simple enough but apparently not. 
    I have phoned over 6 times in the last year to change this. It has still not happened. Several times we were told that on the system it said monthly for it to be then taken out quarterly. In July while we were away this happened again. Only as we assumed that as they had informed us it would definitely be on monthly direct debit that it was the money for the whole of the quarter was not there. So when they took the money for a quarterly bill again. We were charged. It has set back other bills as the money had been eaten up by charges for this. As you can imagine we were quite annoyed. This was not our fault and we felt that BT were not capable of holding our account details without taking money they we repeatedly requested not to. I admit we should have kept a closer eye on our bills account but you don't think that a company will repeatedly do this to you. 
    After phone calls it emerged that they would not say more than a 'sorry' about this. 
    The saga then continued. I cancelled the quarterly direct debit at the back and have asked BT to send me monthly paper bills. Then last month our phone and internet was cut off. 
    We rang up and suggested that due to the mix up could they add the money we owed to our monthly bills and we'd pay this off on top of the monthly bill. Despite that the reason we owe this at all is not through any fault of our own but through theirs. The money would have been available had they taken it as repeatedly requested.
    We were on the phone for 1hr and 10 mins ( 21st September) to three different people. No, they said  must be paid in 10 day. My partner only managed to get money off this in about an hour - the point being we were happy to pay the whole amount over a year and were not allowed. We asked to speak to a manager after 1hr and 10 and were put back to the start of the queue. 16 minutes later the man we spoke to said a manager named Samantha would call us back. No-one did. 
    On the 22nd of september a rather annoyed me called back and repeatedly requested a manager - sadi would be put though. After 17 minutes the phone went dead. 
    Called later on same thing phone went dead after requesting a manager at 10 minutes.
    Later on called for 28 minutes and told the call centre the issue £20 deducted from amount but said it had to be paid in ten days and a  bill would be sent. Was told that the internet would be reconnected that day. 
    23rd September was hung up on after thre minutes on requesting why the internet had not been connected.
    Phoned later. The man that I spoke to said that no action had been put through to reconnect the internet. He would do it and it would be through by 5pm.
    My partner phoned at 8pm when the internet still had not been reconnected. It was done the next day. 
    Today BT phoned to ask if I had the bill ( Not sent) and tell me that the line will be disconnected by the end of the day. i explained that we were in the middle of complaints procedures with them. She looked on the system and said that there were no notes on the account. I asked for a manager and then asked for this managers superior. She put me through to someone that when questioned was not her superior and half way through my explanation of this....you guessed it..... the line went dead. 
    I am so annoyed that we've been fine with bill paying and as of their mistake we're now in debt to them and feel like we can't sort it out as there is not anyone who will listen or help. Has anyone had similar probelms or does anyone have a number for their English call centre?
    Jess

    hi Jess,
    I am really sorry that you have had so much trouble trying to get this sorted out.  I'll get this straightened out.
    Could you drop me in an email please to the address in my profile with your BT account and telephone number along with a link back to this thread.
    Cheers
    Craig 
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)”
    td-p/30">Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Serious issues with Mail

    Mail crashes the moment i click on it. Anyone got any ideas as to why this happens?

    mine does the same, the moment i open open up mail the pinwheel won't stop spinning, and i tried the utility disk repair but still the pinwheel spins upon starting the program-- any luck to fix this serious issue with Mail? thank you.

  • Serious issues with Timer when RunTimeExceptions are thrown in TimerTask

    Hi All,
    I am facing serious issues with Timer and TimerTask.
    Runtime exceptions thrown in TimerTask kill that one thread, thus making Timer dead i.e. scheduled tasks will not run anymore. Is there any way we can overcome this with Timer or it is just not possible?
    I used try, catch blocks in TimerTask for RunTimeExceptions but no luck. Timer is not running any more once TimerTask throws any exceptions. Why it is not able to catch them? Is this known issue with Timer?
    I am using Java 1.5.0_08.
    Any guidance is appreciated.
    Thanks in advance,

    sairamvla wrote:
    Runtime exceptions thrown in TimerTask kill that one thread, thus making Timer dead i.e. scheduled tasks will not run anymore. Is there any way we can overcome this with Timer or it is just not possible?Not possible (at least, not possible just by using a Timer).
    I used try, catch blocks in TimerTask for RunTimeExceptions but no luck. Timer is not running any more once TimerTask throws any exceptions. Why it is not able to catch them? Is this known issue with Timer?It's perfectly possible for you to catch a RuntimeException, in a TimerTask or anywhere else. If you were thinking that there is a language feature or something which makes catching exceptions work differently in a TimerTask, you weren't thinking right. Your code is just wrong.

  • Serious Issues with New Itunes Release

    I'm having serious issues with my Itunes. If I right click on any of the songs and go to reveal in Windows Explorer (so i can find the darn things) it removes pretty much every option from the right click menu, refuses to play music and if i shut down ITunes and try to restart it it refuses to open again. I've tried unistalling and reinstalling the software and i get the same issue. any ideas? its driving me insane and i wish i had never upgraded to the new version because the last version was working just fine.

    Also I see that Itunes remains in my task manager in the processes section even after I close it down. any ideas would be woooonderful because i can't live without my music...

  • Serious issues with ios8

    Serious issues with iPad 2 since updating to ios8. Have to keep restarting the iPad as it is the only way to connect to wifi again, battery drains quickly. Nothing works properly, things keep freezing etc. is there anyway to go back to ios7?

    Try some basic troubleshooting:
    (A) Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    (B) Try reset all settings
    Settings>General>Reset>Reset All Settings
    (C) Setup as new (data will be lost)
    Settings>General>Reset>Erase all content and settings

  • Issue with exported playlist song order

    I exported a playlist (with the playlist sorted on the manually arranged order, far left column) as a .xml file using iTunes 7.0.2. When a friend imports this playlist into his iTunes (7.0.1) the song order is incorrect (again with sorting done on the far left column). When I look at the exported XML file with a text editor the order of the song entries is also wrong in the XML file. Has anyone elsed noticed this problem?

    Actually, I looked more closely in the text editor and the playlist order looks correct so there appears to be an issue with 7.0.1 (I guess).

  • Serious Issue with "third party subscriptions" through text messages.

    Forgive me for perhaps sounding dramatic. After having this experience I nearly paid the fee to break my contract and quit on cell phones all together. If apple gets the iPhone to a point where no cellular carrier is neccessary I will be the first to join the party. I'm going to start trying this skype thing this weekend. Anyway, I digress, here's what happened. I get my bill from AT&T and there is a charge for download activity for $3.99. Not the end of the world but I call the number to find out what the charge is all about because I thought I had an unlimited data plan. Turns out AT&T calls it a third party subscription fee. I argued that if AT&T is charging it on my bill as far as I'm concerned I'm not concerned about the details, I hold AT&T responsable for what they put on my bill. According to AT&T's rep I recieved a text message asking me if I wished to subscribe to their service. I don't do the text thing so I never read any message like this. HERE'S THE KICKER - BECAUSE I DID NOT RESPOND TO THE TEXT TO SAY NO THANKS I WAS AUTOMATICLY ENTERED INTO AN ILLEGAL CONTRACT TO PAY $3.99 MONTHLY FOR A SERVICE I'M NOT EVEN AWARE OF. I was absolutly irate. The ramifications are astronomical. This means I could get a limitless unexpected bill. I look at it this way: If I had to write a letter, address an envelope, and lick a stamp every time I got an advertisement in my snailmailbox, I would never get out of the house and I would have to get on welfare to afford the stamps. To me there is an obvious legal precidence here. I realize that this has more to do with AT&T than Apple. I simply want to emplore Apple to save us from a world of disintigrating business ethic. Cellular providers have gotten completely out of control. When I feel like I need a lawyer just to call AT&T to discuss the inconsistency of my bill there is a serious problem. I feel like entering into a contract with a cellular provider endangers my financial stability in a fragile era. It just seems rediculous for a business to become so arogant that they can speak nonsense to a customer and we are put in a position to defend against such nonsense. Several of my friends have run into the same issue with text third party subscriptions. Last night at a dinner party three indicated that they finally had all the cellular provider crap they could take and they canceled their iPhone service and put it up on ebay. I love my iPhone, it is the most useful piece of technology I have ever had the pleasure to enjoy. That being said, I cannot justify, as a household provider with a family depending on me, taking the risk of financial ruin (a $3000+ cell phone bill could do just that) initiated by arogant buisiness practaces that resemble the oppression I have witnessed through 12 years of military service in places with an excess of sand. I think it is apauling. I believe the FCC and FTC need to be brought into this. I intend to submit formal complaints to both and would encourage others that feel like I do to do the same.

    Not to diss those trying to be helpful, but the do not call list has nothing to do with spam TXT messages sent from a computer, which is where the OP's problem probably began.
    If a third party sent this message and then signed the OP up for a service he did not want, this violates any number of consumer laws and can be addressed that way. It's unclear whether this is really an AT&T issue at all, absent any evidence that it is their message or their service. It sounds to me like the CS reps do not understand the problem and are giving the not-helpful generic answer about spam TXTs. A much better solution is to set the SMS filters using AT&T's web site.
    Similar scams work on landlines, where you can accidentally end up getting a huge charge on your phone bill for something that has nothing to do with the carrier.
    I'd call the state consumer protection department.
    -dan

  • Serious issue with MacBook internet connectivity

    I have owned a 2009 MacBook since around 2011, when I bought it new. Since then, I have had several relatively minor issues with it, including common ones with the trackpad malfunctioning (it needed a new battery). Since last night, however, it's ability to connect to the Interwebs has suddenly vanished. It's not like the cause of my problem is a huge mystery; there was another problem involving the apparent 'simulated' holding down of the power button, making it impossible to turn on without force shutting down after a few seconds. This seemed to resolve itself eventually, after I sat up too quickly and it narrowly avoided being badly smashed on my floor when it tumbled off of the futon. Ouch. However, there was a minor bump before I was able to catch it. I worried that it would be broken, but it actually managed to somehow resolve my previous issue with random shutdowns when it turned on. After this, though, I was stymied by it's inability to connect to the Internet at all. I tried WiFi, Ethernet, circumventing the router with another Ethernet cable, and many other possible fixes. No luck. I'm currently typing this on a seperate computer, which has got internet connectivity with wireless on the same network. With the wireless connection, which was working before the power button incident, I am able to see the network and connect, but then I can't actually resolve my connection. In the native internet support program, I am reportedly able to connect to the network and ISP, but not the internet or test server. I have contacted my ISP, and they vaguely insinuated after half an hour on hold that it should be working just fine. Very oddly and suspiciously, whenever I try to open the normal network control panel in System Preferences, the pane blinks briefly and stops responding, to the point that I left it loading and went to bed. This morning, it was still attempting to load that preference pane, and I'm really pretty confused. What is going on? In case it helps, the corner that hit the floor was the upper right hand one, I have to think that it may be a hardware issue, since I've spent quite a bit of time on software fixes. This is my first question to the community so far, so if I've misplaced it or doen something wrong, I apologize.
    Thank you in advance!

    I have a MacBook Pro that I purchased in April 2007 and am having exactly this issue. I went to start up a program, my screen went black and the computer crashed. I rebooted and my screen had the diagonal lines as in your image. I believe it booted up properly once or twice but crashed again before long. Repeatedly now, the ugly lines are there, the boot up screen shows up in the background and eventually it gets to a blank blue screen and nothing else happens. Sometimes it just shuts down. I did get the install disk and try the hardware test by booting up the disk and holding down the "d" key. The first time I did this it kind of made the screen clear up and reported that there were no hardware problems. I restarted from there and actually had my computer back for about 15 minutes. Then it died again The hardware test didn't have the same impact the second time I tried it but still reported no problems. Still stalling at the blue screen. Does it have something to do with Leopard 10.5.8?? I updated to that a couple of weeks ago. Seems kind of random and inexplicable. Oh and I actually saw a wee puff of smoke at one point near the power button. Is something frying? I really would like to figure it out so A) I can rescue all my stuff that's on that machine and B) if I can fix the problem the computer will still be of use.

  • Serious issue with password manager - mouse selection in MS word 2007

    A little while ago, after installing some thinkvantage updates, I started to loose selection with the mouse in microsoft word 2007 after few minutes of usage (and derivatives such as outlook). I have a T61 with Windows 7 64 bit ultimate.
    I did many internet searches and surprisingly many other users who had this issue were Lenovo users so I'm not even sure if this issue is windows 7 specific.
    Disabling totally the password manager solved the problem - so there might be a serious issue there...
    Erik.

    Confirmed here http://forums.lenovo.com/t5/Windows-7-Discussion/Weird-issues-with-T61-and-Win-7/td-p/179635
    I forgot to subscribe to the topic

  • Serious Issues with Lumia 820

    Dear Sir/Mam ,
    I am very sorry to inform you that i have been using Nokia Lumia 820 since past  3 months , and every day i am facing new problems . Few problems I already mailed you before ( Service request no : 1-6KQPRQV )
     ,which started persisting within the 7 days of purchase . It is a very bad experience for a genuine customer like me , as nokia is like a family to me . Every one including my mother , father , brother are using Nokia and never faced problems since we started using cell phones .
    Apart from problems i mentioned before ,few serious problems I have been facing past few days are as below :
    * People i speak with are not able to listen me properly (my voice reaches them very low) , the problem is not permanent though but it rises anytime .
    *My volume key button do not respond , as i cannot change volume of the songs for hours even though i can see the volume rising and falling in display .
    **** and the most important problem which i faced today is very upsetting and i am in real pain because of it , my phone dropped from a height not more than 1/2 feet ( i mean it) and my lowermost screen is damaged . I was not believing my eyes when i saw it . How can be the the screen of a phone which costs me Rs 23,800 be so soft .Thank god display is working  but i am unable to use windows key button . 
    I am very upset because of it . Being love with Nokia i borrowed it on installments , half of which are still pending and I am in no position to spend money on my 3 months old phone . 
    Please suggest me what to do , hoping for your early response . 
    Thanks & Regards ,
    Gaurav Singh
    Solved!
    Go to Solution.

    Before I start, please note that this is a user to user forum.
    Sorry to hear about the problems you are experiencing. Does sound like there are issues with your handset because it is definitely not behaving normally. Your first port of call should be your local Nokia Care Point. They should be able to assess the issues with your phone and advice you on the options available to you. 

  • Serious Issues with Regions

    JDeb 11.1.1.3, Windows 7 x64
    I am finding serious issues in regions.
    I have a series of page fragments defined in a ADF task flow.
    When I change data in them the Commit does not reflect the change unless I go to another page and return (unacceptable for the client).
    When I programatically add records to a table, they are not shown - the table does not refresh - even with an execute button (which should re-execute the query and redisplay the table), unless I leave the jspx that contains the region (unacceptable).
    I have tried to requery, get the datacontol view object and requery it - I believe the data is updated - the table just will not show the data (not refreshing).
    on pages with forms - when I create a new record (CreateInsert) and add data - the save button never activates until you move to another page and back again.
    It looks like there are overall issues with the refresh functions in the region.
    maybe I am missing some "magic", but this should be simple - straight forward - using partialTriggers - as it is in any other jspx.
    Are these issues bugs or are there special considerations in regions for this.

    Read carefully the article "17.5. Refreshing an ADF Region" in the "Fusion Developer's Guide for Oracle ADF".
    It is not enough to set the partialTrigger attribute of the <af:region> tag in order to refresh the task flow. In order to refresh the task flow you should use the attributes "Refresh" and/or "RefreshCondition" of the taskflow binding in the corresponding PageDef.
    For example, if your taskflow has parameters and you want the taskflow to be refreshed if some of the parameters has been changed, then you should set <tt>Refresh="ifNeeded"</tt>.
    If your taskflow does not have any parameters then you can set <tt>Refresh="default" RefreshCondition="#{<some_EL_boolean_expression>}"</tt>. In this case the taskflow will be refreshed depending on the value of the specified boolean expression. For example, you can base the boolean expression on a managed bean property that is set by you to true whenever you want the taskflow to be refreshed.

Maybe you are looking for