Apple Script: Script works in Editor but not in iTunes

Ok so I have written/cobbled together other peoples scripts to make my own script but now it will only work in Script Debugger 4.5 or AppleScript Editor??? When I exicute the script in the editors it works perfectly, but when its saved and added to the iTunes script folder it all works except for one part.
This part is supposed to duplicate the iTunes file then open it back into itunes, so I have two copies of the file (so I can alter one). Now in itunes everything works but it seems to be skiping over the open command??
any help would be appreciated
to DuplicateItunesFiles()
    set trackTitleList to ""
    tell application "Finder"
        repeat with i from 1 to the count of the selected_track_files
            set currentFile to item i of selected_track_files
            set currentTitle to item i of track_titles
            set trackTitleList to trackTitleList & ", " & currentTitle
            open (duplicate currentFile to folder of location_file)
        end repeat
        if trackTitleList is "" then
            display dialog "Sorry, couldn't duplicate your tracks."
        end if
    end tell
end DuplicateItunesFiles

Ya sorry about that, the script is long and poorly made so I didnt want to scare people of haha.
Here is a link to the script I am having trouble with (Version 5.2): http://pastebin.com/dGsHifZM
and I'm not sure if this is helpfull but here is an older version that works...in both the editor and iTunes http://pastebin.com/chb19KNQ
Errors: I get this error only sometimes:
Can’t get «class cTrk» 1 of «class pPla» of application "iTunes".
Edit: Can I not edit my origonal post to add the links into it?

Similar Messages

  • Music works on iPhone but not on iTunes

    A really good chunk of my music doesn't work on iTunes anymore - I'll try to play it but get the message that iTunes can't find the file. It definitely still works on my iPhone, but I'm afraid to sync because I'm worried that what music does work on the iPhone will stop working when it syncs with iTunes.
    What can I do to get the music that works on my phone back onto iTunes? I probably haven't synced the two since maybe the holiday season; I don't remember how long this has been happening, but it's not new.
    Thank you in advance!

    I figured out how to remedy this last night. I had to pull my music off of my iPhone since it was no longer on my hard drive -- I used a free program called [Senuti|http://www.fadingred.org/senuti> to transfer the music (note: you have to download the Beta, which is linked at the bottom of the page, for it to work with an iPhone).
    The program's website has instructions on how to do the transfer without your phone syncing to your computer (which might delete the music from your phone that's missing in iTunes).
    Senuti works by figuring out which music is already on your computer, and copying any music that isn't already there. The problem with this is that all of your music is listed in iTunes even though the files aren't there, so Senuti won't copy anything without some extra steps first.
    I had to delete all the songs in my iTunes library (from within iTunes -- and make sure you choose to *keep the files* on your hard drive).
    Then in iTunes, I chose *File >> Add To Library...* (or Command + O). By default my iTunes Music folder was already chosen, but you might have to navigate to it and then click "Open."
    This will add the files that you do have back into your library. After this, use Senuti and it will copy over all of the missing files from your iPhone to your computer.

  • Apple tv 2 recognizes my computer, but not my itunes movie

    I'm downloading WANTED (purchased not rented) from iTunes. But it doesn't show up in my Apple TV 2. I have a couple of little movie clips not from itunes, and Apple TV sees them. Why can't I watch a purchased movie on my TV? Not even that Apple TV icon on my MacBook Air.
    Thanks in advance!

    Without knowing exactly what troubleshooting you've tried, if you are using a Windows based computer, try iOS: Device not recognized in iTunes for Windows
    Disable a/v software and turn off the Firewall.. see if that helps.
    Disable antivirus software
    Turn-Windows-Firewall-on-or-off

  • HT1310 my apple id password works on iPad but not on iMac?

    My password which is active for ipad and iphone does not work on the imac?

    Go to Settings>iTunes and App Store and sign out and sign back in if you ohave not done so already

  • I have a JavaScript loop that works in Dreamweaver but not in my browsers. What's missing? Should the page load another script first?

    I know that the code is clean because it runs perfectly in DW (even with the occasional lag). Shorter loop functions have also worked in DW, but not in my Chrome or IE browsers. Is there a script or program that the HTML should run first?

    I'm sorry, of course:
    The Crow Haven Witches and Psychics of Salem
    I am designing a phone psychic hotline (don't ask! ) page, and the loop is supposed to sort the readers according to their availability. Each should appear in their respective listing.
    The setup works perfectly in DW, but none of the scripted material appears in the current page. I will add a photo of how it does look in DW.

  • Script works in ISE but not in regular Powershell

    I created a script that will read in files, encrypt them using openssl, and then remove the original. Only downside is that the script only works in ISE and not in powershell.
    On powershell command line the line "remove-item $file" ends up being an entire list of files instead of a single file. While in ISE the command is the single file instead of the list of files.
    Code in question:
    $file= get-content $file
    Foreach ($file in $files)
       $in=$null
       $out=$null
       #set the in and out files
       if ($enc -eq "-e")
          $in = "$file"
          #add .enc to let people know it is encrypted
          $out= "$file" + ".enc"
          }else{
          #we are decrypting
          $in="$file"
          #remove the .enc at the end of the string to restore to normal      
          $out="$in" -replace ".enc"        
        if ($file -eq ".enc")
        break
        $run = $cmd  + " enc" + " -" + $type + " -pass pass:" + $password + " " + $enc + " -in " + $in + " -out " + $out
        invoke-expression $run
        remove-item $file
        $in=$null
        $out=$null
    any help would be wonderful

    Technically it starts with my parameters and setting up the openssl command. Here is the mostly full version - i can give the full full one if you want.
    $files= get-content $files    
    #check the switch to see if we are encrypting or decrypting
    $enc="-e"
    if ( $decrypt)
       $enc="-d"
    Foreach ($file in $files)
       $in=$null
       $out=$null
       #set the in and out files
       if ($enc -eq "-e")
          $in = "$file"
          #add .enc to let people know it is encrypted
          $out= "$file" + ".enc"
          }else{
          #we are decrypting
          $in="$file"
          #remove the .enc at the end of the string to restore to normal      
          $out="$in" -replace ".enc"        
        if ($file -eq ".enc")
        break
        $run = $cmd  + " enc" + " -" + $type + " -pass pass:" + $password + " " + $enc + " -in " + $in + " -out " + $out
        invoke-expression $run
        remove-item $file
        $in=$null
        $out=$null
            

  • Password on apple id works on iPad but not on Mac Pro

    Pass word on apple id works with iPad but not on Mac Book Pro, what is the solution, I have tried to reset password but that does not seem to solve the problem.

    It kind of depends on where you're entering the password on the MacBook Pro. iTunes Store? App Store?
    Try the password on this website https://id.apple.com/ (click on [manage my apple id]
    If it works on that website there's nothing wrong with your apple id or password. In that case we really will need to know exactly what you're trying to do when you're getting the password error.

  • Apple ID works on iPad but not on my MB Air

    Apple ID works on iPad but not on my MB Air

    Even though it works on the iPad, try resetting your Apple ID password on your MB Air >  My Apple ID

  • Java calendar works in IE but not in Firefox

    This Java code works in IE but not in Firefox - any ideas - tks
    <pre><nowiki><TABLE bgColor=#ffffff border=1 cellPadding=0 cellSpacing=3 id=calendar style="DISPLAY: none; POSITION: absolute; Z-INDEX: 4; left: 28px; top: 365px">
    <TBODY>
    <TR>
    <TD colSpan=7 vAlign=center> <!-- Month combo box -->
    <SELECT id=month onchange=newCalendar()>
    <SCRIPT language=JavaScript>
    // Output months into the document.
    // Select current month.
    for (var intLoop = 0; intLoop < months.length; intLoop++)
    document.write("<OPTION " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]);
    </SCRIPT>
    </SELECT>
    <!-- Year combo box -->
    <SELECT id=year onchange=newCalendar()>
    <SCRIPT language=JavaScript>
    // Output years into the document.
    // Select current year.
    for (var intLoop = 1900; intLoop < 2028; intLoop++)
    document.write("<OPTION " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop);
    </SCRIPT>
    </SELECT>
    </TD>
    </TR>
    <TR class=days> <!-- Generate column for each day. -->
    <SCRIPT language=JavaScript>
    // Output days.
    for (var intLoop = 0; intLoop < days.length; intLoop++)
    document.write("<TD>" + days[intLoop] + "</TD>");
    </SCRIPT>
    </TR>
    <TBODY class=dates id=dayList onclick="getDate('')" vAlign=center> <!-- Generate grid for individual days. -->
    <SCRIPT language=JavaScript>
    for (var intWeeks = 0; intWeeks < 6; intWeeks++)
    document.write("<TR>");
    for (var intDays = 0; intDays < days.length; intDays++)
    document.write("<TD></TD>");
    document.write("</TR>");
    </SCRIPT>
    <!-- Generate today day. --></TBODY> <TBODY>
    <TR>
    <TD class=today colSpan=5 id=todayday onclick=getTodayDay()></TD>
    <TD align=right colSpan=2><A href="javascript:HideCalendar();"><SPAN style="COLOR: black; FONT-SIZE: 10px"><B>Hide</B></SPAN></A></TD>
    </TR>
    </TBODY>
    </TABLE></nowiki></pre>

    Document.all doesn't work in Firefox, you need to use document.getElementById().<br />
    See https://developer.mozilla.org/En/DOM/document.getElementById
    <pre><nowiki> var parseYear = parseInt(document.all.year [document.all.year.selectedIndex].text);
    var newCal = new Date(parseYear , document.all.month.selectedIndex, 1);
    </nowiki></pre>

  • Slide show works on PCs but not on Macs

    A parent at the school where I teach has just created a
    website for us. She used Dreamweaver and photoshop to create it.
    There are some pages where there should be a looping slide show
    (that runs on its own). These slide shows work on PCs but not on
    Macs (it just stays on one photo on Macs). For the slide show she
    "just added a timeline to the jpg image, changing the imagesource
    every 60 frames, that you can do in dreamweaver." Is there some way
    to fix this so it works on both?
    Here's the school's website: www.smash.smmusd.org

    Unfortunately, the timeline function may not be the best way
    to do this.
    Notwithstanding Joe's comments about 508 compliance, there
    have been issues
    reported in the past regarding the use of timelines on Macs.
    It may be
    better to seek some 'banner rotation' scripts using Google,
    and replace the
    timelines with that script. Your volunteer may or may not
    know how to do
    that....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]..
    > On 16 Jun 2007 in macromedia.dreamweaver, Mana Hale
    wrote:
    >
    >> A parent at the school where I teach has just
    created a website for
    >> us. She used Dreamweaver and photoshop to create it.
    There are some
    >> pages where there should be a looping slide show
    (that runs on its
    >> own). These slide shows work on PCs but not on Macs
    (it just stays
    >> on one photo on Macs). For the slide show she "just
    added a timeline
    >> to the jpg image, changing the imagesource every 60
    frames, that you
    >> can do in dreamweaver." Is there some way to fix
    this so it works on
    >> both?
    >>
    >> Here's the school's website: www.smash.smmusd.org
    >
    > I'd worry about accessibility/Section 508 issues before
    I worried
    > about slideshows. That page is all images.
    >
    >
    http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&url1=http%3A%2F%2Fwww.sma sh.smmusd.org%2F
    >
    http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=2&url1=http%3A%2F%2Fwww.smas h.smmusd.org%2F
    >
    > --
    > Joe Makowiec
    >
    http://makowiec.net/
    > Email:
    http://makowiec.net/contact.php

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • Apple, Pfft!!! (Another iPod shows up in Windows but not in iTunes post)

    How in the world does Apple market the iPod, etc... as if 10-year olds and grandmothers can operate the technology, when having viewed these message boards for 10 hours yesterday, it seems as even the tech savy people who can make a computer out of two pieces of bread and a piece of bologna have to wrack their brains to make it come a step closer to actually working. Blah!!!
    Anyway, the problem that I am having is the problem that a lot of other people are having and seems to be the main theme at the moment.
    I am unable to have iTunes recognize my iPod. My PC will once-in-a-blue-moon recognize the iPod as its own drive in Windows Explorer, but mostly all I get is the big freeze. Every time I connect my iPod to the USB, all of the programs cease to operate until I unplug it. I am not having memory problems either.
    Here's what I've done. I have updated the iPod Updater to the 06-23-06 version. I was able to get it to update the software on my 60GB iPod. I got all excited only to then have it give me several error messages 1) an internal manager error and 2) some unable to dock or something like that (sorry I'm not at my home cpu.) Once while I was doing the 4-hour battery charge my iPod came up in the source list in iTunes, but I have been unable to have it be rerecognized.
    I've unistalled and reinstalled iTunes and the iPod Updater over 10 times and have gone through the 5 Rs as well as all of the steps on
    http://docs.info.apple.com/article.html?artnum=93716 (My iPod shows up in Windows but not in iTunes)
    I've even messed with msconfig and tried a whole bunch of other suggestions. It doesn't seem that Apple has a fix for this problem and we are all left with paperweights.
    Any suggestions?
    Thanks you all and condolences to everyone who is going through this same problem. I swear what happened to plug and play. Pfft!!!

    You know they are probably going to search me out and crash my computer for posting this but i had the same problem with iTunes. i spent hours, went through the 50000 "R's" and changed my settings and formatted and reset and reloaded and then i tried Realaudio. it found all the songs i had loaded into iTunes and put them on my shuffle first try. you can get Realaudio at <www.real.com> Let me know how it works...

  • TS1363 my ipod classic is visible in windows but not in itunes, this happens on 2 different computers where my iphone and ipod touch work fine which leads me to think something is up with the ipod itself and i cant find any threads to help

    my ipod classic is visible in windows but not in itunes, this happens on 2 different computers where my iphone and ipod touch work fine which leads me to think something is up with the ipod itself and i cant find any threads to help.
    any thoughts anyone??

    Perhaps the reason you haven't had any replies is because there is no such thing as an 8GB iPod Classic.
    I suggest that you begin by correctly identifying which iPod you have.
    http://support.apple.com/kb/HT1353

  • TS1363 "iPod: Appears in Windows but not in iTunes" Isn't working!

    I've tried all of the things in the "iPod: Appears in Windows but not in iTunes" but none of them work.
    I'm on Windows 8 and those are the instrucations I've followed.
    The only thing I haven't done is reset my computer to factory mode but that Isn't an option for me cause I got saved games that can't be backed up.
    I've literaly tried everything in that help page and it doesn't work.
    All I get is the iTouch charging, asking me to trust the computer, I say trust, nothing happens, I check the device manager and it doesn't shw the USB no matter what, I restart the ipod services and the apple software services, nothing happens, I completely take dwn my McAfee firewall and scanning system, it doesn't work, restarting it to make sure no viruses attack, uninstalled Razer Synapsis because it has been a pain in the butt before, that doesn't work, I emptied my Temp file and that didn't work, And in the end the iTouch is charging but not even being see by Itunes and no updates, restarts, reinstallations, uninstallations, checking, researching, and anything else I can do works.
    Can someone please explain why apple tech is such a pain when it comes to Windows 8 and how I can fix this without losing 2 years worth of school and saved games?!?!?!?

    Try a full teardown as in Troubleshooting issues with iTunes for Windows updates?
    A recent poster to forum is suggesting uninstalling WMP from Windows?
    Connect the device to a different compuer and back it up there. You should be able to copy off the library to a portable hard drive. See also Recover your iTunes library from your iPod or iOS device.
    tt2

  • Mac mini webcam works on facetime but not oovoo

    I am using a Rocketfish hd webcam and it is working on facetime but not on oovoo. Can someone provide a solution?

    P.S.
    If the third-party support info and help does not get it working for you, you can also use OS X Mavericks recovery or reinstall to repair your startup disk or reinstall OS X 10.9.
    Also Apple's http://support.apple.com/kb/HT2090
    (Over time, Apple has changed the built-in camera's name on newer Macs from "iSight" to "FaceTime" and then to "FaceTime HD."  Regardless of the name of your Mac's built-in camera, the same info and troubleshooting applies.)
    Message was edited by: EZ Jim
    Mac OSX 10.8.5

Maybe you are looking for