I need help tweaking an iTunes script to add comments

Hi all,
as I don’t want to carry all the tracks in iTunes on my iPod, I have it to update some playlists only. One of these playlists is a smart one, that looks for the comment "Go iPod". And I have an applescript that sets the comment for the currently selected song(s) to "Go iPod".
It also skips to the next song in the library/playlist.
The script worked for over a year now, but today it got a hiccup. Instead of altering the comment for the curryemtly playing song and skipping to the next one, it alters the comment for two songs and skips to the third. Has something changed in iTunes 8.1?
Here’s the script:
property separator : "
tell application "iTunes"
set thePlaylist to view of front browser window
if selection is not {} then
set sel to a reference to selection
else
if thePlaylist is not library playlist 1 then
set sel to a reference to every track of thePlaylist
else
display dialog "Select a track or playlist" buttons {"Cancel"} default button 1 with icon 2 giving up after 15
end if
end if
play (next track)
repeat with this_track in sel
set this_track's comment to ("Go iPod")
end repeat
reveal current track
end tell
What do I have to change?
Message was edited by bambule: made everything in the script English and reformatted the post

UPDATE:
Apparently the script is ok. It works like a charm when I select it via the scriptsmenu.
Alas, I have assigned it a keyboard shortcut. And scripts that are envoked by a keyboard shortcut are running twice in iTunes 8.1.
Off to file a bug report.

Similar Messages

  • HT201269 I'm not a tech person, but need help with my Itunes account in transferring money and downloads onto new phone I purchased 2 weeks ago when my Iphone was stolen. I don't know how to get the money or music on new phone?

    Need help with Itunes transferrs and can I use my Edge phone as a router?

    I'm not a tech person, but need help with my Itunes account in transferring money and downloads onto new phone
    Is this an iPhone?
    Set it up using the AppleID you used on the previous iPhone.

  • Need help with my iTunes on iPhone 5 and Macbook Pro

    Need help with my iPhone 5 and my Macbook Pro.  I was purchased some music on itunes at my mac. Some reason I deleted those music from both on Mac and iPhone 5.  Today, I went to my iPhone iTunes store inside of iCloud to redownload my puchased. But those song won't able to sync back to my iTunes library on my Mac.  Can anyone help me with that ??....

    You've posted to the iTunes Match forum, which your question does not appear to be related to. You'll get better support responses by posting to either the iTunes for Mac or iTunes for Windows forum. Which ever is more appropriate for your situation.

  • Need help making a simple script for my webcam

    Hey everyone, fairly new to applescript programming. I just bought a usb camera for my macbook because I use it for video conferencing/playing around, and it is better quality than the built in isight. However, in order to use this camera I need to use drivers from a program called camTwist. This being said camTwist needs to be opened first and the usb camera must be selected from camTwist Step 1 list in order for any other application to use the camera. I just want to make a simple program that would open camTwist first, then select "webcam" from the list (double click it like I always have to in order to select it) in order to activate the driver, and then open photo booth which would then be using the camTwist driver in order to take pictures.
    I made a crude program but it does not automatically select "webcam" from the Step 1 list in camTwist:
    tell application "CamTwist" to activate
    delay 10
    tell application "Photo Booth" to activate
    that’s basically it. I set the delay to 10 seconds so that when camTwists boots up first I can manually select my webcam. HOWEVER, I would like to make a script that would boot up CamTwist first, select my webcam from the list automatically, and then open Photo Booth with the CamTwist webcam driver already selected.
    Don't know much about applescript so any help to make a working script to solve my problem would be greatly appreciated! Thanks!

    Solved my problem but now I need help with something else! First I used CamTwist user options to create user defined hot keys with the specific purpose to load the webcam. I chose Command+B. I tested it out in CamTwist and it worked. The program follows a logical order from there. First it loads CamTwist, then after a short delay it presses the hot keys in order to load the webcam from the video source list, then another short delay and Photo Booth is opened with the driver loaded from camTwist. Everything works Perfect! Here's the code:
    tell application "System Events"
    tell application "CamTwist" to activate
    delay 0.5
    --Press command+b which is a user defined hot key to load webcam
    key code 11 using command down
    end tell
    delay 0.5
    tell application "Photo Booth" to activate
    My Next question is, would it be possible with this same script to have both applications quit together. For example I always quit Photo Booth first, so when I quit photo booth is there a way to make CamTwist also quit and keep everything within the same script? Please let me know. This forum has been very helpful and lead me to a solution to my problem! Hoping I can solve this next problem as well! Thanks everyone.

  • Need help with my iTunes-new computer-can't access my music

    We just got a new computer and I transferred all of my songs from the old to the new and now when I try to access them in iTunes I get an error message that "it cannot be used because the original file cannot be located" Do I have to put in the DVD with all of the files on it in order to use any of my song? I thought that I saved them to my hard drive, but who knows....HELP!!! pLEase!!!

    You haven't told us enough about what you did.
    You need to explain exactly how you did your transfer.
    If you don't care about your ratings and play counts and your really did copy your files across, there is a simple way of getting going again.
    With iTunes closed drag iTunes Library.itl and iTunes Music Library.itl out of the iTunes folder to the desk top.
    Start iTunes and you will have an empty library. Now simply add the folder with your music files in it - normally iTunes Music - to iTunes with File>Add folder to library.
    If you didn't copy your files across, try putting the DVD in the drive and opening iTunes - can iTunes find your files now. If so it is a sign you added the files to your library without copying them to your internal HD.

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • HT204406 Hello, I need help with my iTunes match

    Helo, I need help with iTunes Match.
    I signed up for iTunes match.  It did its thing and now it is supposed to have every one of my songs in the cloud.
    I checked for Ring my bell (Which I purchase from iTunes) and it is not on my iTunes on my computer anymore?
    I did match to give my 4S with limited memory and over 400 songs the ability to put all songs in the cloud, then by connecting to my computer, somehow I can tell my phone to not sync with match, the re sync and all the songs would be deleted from my phone and then I could down load any songs I wanted on my phone, thus giving me a bunch more memory.   I could not figure out how to do this? 
    Can you please help me.  Thank you.

    You probably won't like this suggestion, but I suggest you reinstall Lion.
    First, backup your system. Next, reboot your system, press/hold the COMMAND-R keys to boot into the Recovery HD. Select 'Reinstall Mac OS X'. If you purchased Lion as an upgrade to Snow Leopard, the reinstall process will install Lion 10.7.3. If your system came preinstalled with Lion, you might still get Lion 10.7.2. Both installs are a total install of the OS. None of your apps or data will be impacted. Just the OS.

  • Need help with a FormCalc scripting

    I am new to FormCalc and need some help. I am creating an interactive PDF in which I need a FormCalc script code for the following situation. I need to have a check box initate a script in another field. For example; I have one numeric field for quanity ordered (user input) and a check box for an optional add-on. Once the check box for the add-on is selected; I need a third field to reflect the price of the add-on * the numeric value in the quanity field.
    ProductPrice     Product Quanity          Add-On                        Total Cost
    Pd1                    2                              ($300) check box            Product Price * Product Quanity  + Add-On Price (if clicked) * Product Quanity
    Can anyone help?

    That was helpful but I still can't see to get it work. In the form I am creating The field that needs to autocalc. is to be triggered by the user clicking an add-on box. I have the add-on checkbox values set as 1=check and 0=unchecked. The idea is that when the that box is checked, the "ItemTotal" field to be calculated will be triggered to then take the Quanity field and mulitply by 300. Below is the script I tried to use and the error message returned when the Add-on box is checked.
    if (Add-onBoxName == 1) then
         Quantity * 300
    Error message in Adobe Reader when box is checked:
    Script failed (language is formcalc, context is xfa[0].form[0].topmostSubform[0].Page2[0].Add-onCheckBox[0])
    script=if (Add-onCheckBox = = 1) then
    ItemTotal = Quantity * 300
    Error: syntax error near token '300' on line 4, column 0.

  • Really need help - Lost All iTunes Files!  I don't want to lose everything!

    I moved recently and when I replugged my computer, all my iTunes songs were lost. I still have the songs on my ipod mini and I'm not daring to plug it in. I really want to restore my files.
    I figure that I need to do this as if I got a new computer and re-install it. However, I am told that ipods are a one way stream from computer to ipod only and not vice versa. I'm hoping someone can help me because I have bought songs that will be lost too. If I didn't have the purchased songs, I wouldn't mind re-importing all 86 CDs of mine (although it would be a pain).
    Please help me ASAP. My CD collection is growing fast and I have a very long bus ride.
    Thanks.
      Windows XP  
      Windows XP  

    Perhaps you may still have the music files on your PC -- but not seen in iTunes or the PC.
    Do a thorough search of your PC using the tips below:
    First - Make sure that you enable your Windows Explorer to view 'Hidden' files:
    - Open Windows Explorer
    - Select 'My Computer'
    - On the main Windows Explorer menu: Tools=>Folder Options=>'View' tab
    - In 'Advanced Setting' --> Files and Folders --> Hidden files and folders:
    -- Select 'Show hidden files and folders’
    - Click 'Apply to All Folders'
    - Click 'OK'
    Then check using Windows Explorer in 'My Music\iTunes\iTunes Music\...' for folders containing your music (or wherever you keep your music folders).
    Also check in your Recycle Bin to see if you accidentally deleted it. If so, ‘Restore’ it back to it’s original spot.
    Then try running a search using Windows Explorer (or similar) for files with the extensions of: m4a, m4p, MP3, OR with the partial names of the songs you are missing.
    Do all the above before you decide that your music files have been completely erased from your hard drive.
    If you can locate the music files/folders, we can get iTunes to recognize it. Try one of these:
    If you have a backup iTunes database file available....
    1. --- Close iTunes. If you have a backup (or previous version) of the ‘iTunes Library’itl’ database file, then place a copy of that file in the ‘...\My Music\iTunes’ folder (or wherever the current, incomplete file resides).
    If no backup ITL file exists….
    2a. --- In iTunes choose: Edit==>Preferences==>Advanced tab. Select 'Change' and browse to the music folder in your PC drive (if it isn’t already). Click OK to save that setting.
    Then....
    2b. --- In iTunes choose: File==>’Add Folder to Library’ & browse to the music folder in your PC drive. Click OK.
    Without the ITL file, re-‘Adding’ the music files to the Library will lose you the Ratings, Play Counts, Date Added and Last Played attributes, as well as your Playlists. No real way to recover them if you haven’t made prior backups. Something to consider for the future....
    If your music files are truly gone, and you have some or all of your music files on your iPod, these links will give you several methods of recovering whatever songs remain on your iPod; some free, some third-party software, some more comprehensive for restoring playlists, ratings, playcounts, etc. Read them and their associated links before deciding on a strategy that works for you. There are many various third-party software programs that will offer a more robust process, or an easier GUI. Do a Google search for them if the links below leave you wanting…
    Don King Resurrected: Deleted files from hard drive (free user steps – music recovery only)
    MacMuse: Computer Crashed (free user steps – music recovery only)
    Copying music from iPod to computer (a primer on various methods and software)
    Copying Songs from Your iPod to a Mac or PC (resource for 3rd party software)
    iPodRip Software
    PodUtil Software
    XPlay (Software For Cross-Platform Functionality & Music Recovery)
    XPlay Photo Browser (For recovering Photos)
    After recovering your song files, strongly consider developing a thorough backup strategy for just this type of situation.
    You need at least three sets of your music:
    -- One full set on the PC within iTunes (on internal HD or ExHD)
    -- One full set on an separate external backup medium (CD/DVD/ExHD/other)
    -- One (full or partial) set on the iPod
    Music files on just the iPod and the computer is not considered having any backup. If you cannot store your complete music files on the computer, then create and maintain two external sets.
    Backup both the music files and the Library database file (iTunes Library.itl). What are the iTunes Library files?
    Here is a post on developing a backup strategy: http://discussions.apple.com/click.jspa?searchID=394618&messageID=1263275

  • Need help getting ALL iTunes from old comp hard drive

    Old computer XP Home died after house was hit by lightning. Surge protector gave it's life but not enough to save the day. However both hard drives from old computer are fine and function via connection of USB external hard drive enclosure.
    New computer is Vista Home Premium on AMD64duo w/4G RAM and 500GB hard drive.
    Connected old hard drives to USB and can see everything. Did Import Folder and copied most files from old iTunes Music directory. (I say most files because iTunes continues to crash after approx 10 minutes of this copy process. On 17th try now.)
    Can see and play the music that got copied but artwork is gone. Playlists are gone. Ratings gone. Basically all the preferences of how I had the old iTunes setup.
    Needing help in understanding how to get Artwork and anything else I can from the old iTunes.
    Have not tried to plug in iPod yet. Will wait atm.
    First old drive had Program files and Second old drive had all Data files.
    AMD64 AthlonX2   Other OS   Vista Home Pre AMD64 duo 4G
    AMD64 AthlonX2   Other OS   Vista Home Pre AMD64 duo 4G

    First, I followed the instructions on this site for Backing up itunes library by copying to a external hard drive.........
    That's what it does. It makes a backup copy of the iTunes folder. iTunes will not use that folder or do anything to that folder.
    All that succeeding in doing was mirroring whatever I did on the C:/ drive on the E:/ drive i.e. if I deleted itunes from the C:/ drive it disappeared from the E:/ drive.
    Do you mean after you followed the instructions and copied \Music\iTunes folder to the external drive and then deleted something from iTunes, it deleted it from the external drive also?
    As above, iTunes will not use or do anything to that folder.
    Next, I followed these instructions for Moving the itunes media folder to the external drive.
    Why? You already copied the entire iTunes folder (including th emedia folder) to the external drive.
    Hold Shift and launch iTunes.
    Select *Choose library* and select the _iTunes library.itl_ file in the iTunes folder on the external.
    This too didn't help as the media folder is not the problem, its the library as its 735kb!
    What do you mean "the library"?
    735kB is small for the iTunes library.itl file and a single file in iTunes is larger than that.
    Am I right in thinking there's no way of moving the library to the external drive whilst wiping it from the C;/ drive?
    Yes. Follow my intruction above (Choose library) and iTunes will use the iTunes folder on the external.
    You can then delete \Music\iTunes on the C: drive.

  • TS2446 i need help with my itunes

    i need help please

    Help with what?
    There is a lot to iTunes what part of it is not working for you?
    Allan

  • HT201363 I need help with my iTunes

    I need help with my iTunes

    Devices can only sync with one library at a time.  If you sync with a different library it will erase other content and update according to the new library.
    iTunes: Syncing media content to iOS devices and iPod - http://support.apple.com/kb/HT1351 - detailed example: https://discussions.apple.com/message/18860187
    iOS: Syncing with iTunes - http://support.apple.com/kb/ht1386 -  You can sync everything or selected playlists.  "WIth iTunes 10, when automatically syncing, you can also manually drag items to the iDevice. These will show up in Manually Added Songs at the bottom of the Music tab after Playlists, Artists Genre, Albums." - https://discussions.apple.com/message/18919754

  • Need help publishing a php script

    I am reading the book Dreamweaver CS5 with PHP training from the source and I have reached page 247. I want to publish a registration field to my site, but I have encountered a problem I cannot solve. The file path in library works fine on the local testing server since it has access to my user folder. When I am uploading the site to my remote server, i can't seem to find the right file path at the beginning of library.php
    The code looks like this now
    <?php
    $library = '/home/1/r/rentsch/Scripts/php_library/ZendFramework/library';
    When I press the register button on the page I get this message:
    Warning: include_once(Zend/Validate/Stringlength.php) [function.include-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Warning: include_once() [function.include]: Failed opening
    'Zend/Validate/Stringlength.php' for inclusion
    (include_path='.:/usr/local/php5-suphp/lib/php:/home/1/r/rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Fatal error: Class 'Zend_Validate_Stringlength' not found in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/user_registration.php
    on line 16
    Before I had that file path I got this message:
    Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    Fatal error: require_once() [function.require]: Failed opening required
    'Zend/Loader/Autoloader.php'
    (include_path='.:/usr/local/php5-suphp/lib/php:rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    I am renting a server from domainnameshop.com (in norway)
    And the page I am trying to upload to is www.rentsch.no/fredrik/Seterpaintball/registrer.php
    It is on norwegian, but it is the button that sais registrer that triggers the errors.
    I really need help on this, I can't find any solution on my own!

    I am reading the book Dreamweaver CS5 with PHP training from the source and I have reached page 247. I want to publish a registration field to my site, but I have encountered a problem I cannot solve. The file path in library works fine on the local testing server since it has access to my user folder. When I am uploading the site to my remote server, i can't seem to find the right file path at the beginning of library.php
    The code looks like this now
    <?php
    $library = '/home/1/r/rentsch/Scripts/php_library/ZendFramework/library';
    When I press the register button on the page I get this message:
    Warning: include_once(Zend/Validate/Stringlength.php) [function.include-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Warning: include_once() [function.include]: Failed opening
    'Zend/Validate/Stringlength.php' for inclusion
    (include_path='.:/usr/local/php5-suphp/lib/php:/home/1/r/rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Fatal error: Class 'Zend_Validate_Stringlength' not found in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/user_registration.php
    on line 16
    Before I had that file path I got this message:
    Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    Fatal error: require_once() [function.require]: Failed opening required
    'Zend/Loader/Autoloader.php'
    (include_path='.:/usr/local/php5-suphp/lib/php:rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    I am renting a server from domainnameshop.com (in norway)
    And the page I am trying to upload to is www.rentsch.no/fredrik/Seterpaintball/registrer.php
    It is on norwegian, but it is the button that sais registrer that triggers the errors.
    I really need help on this, I can't find any solution on my own!

  • I need help changing my iTunes syncing for iPad and iPhone when I connect Ed my iPhone to computer it has a different name from my laptop so I can't sync iPhone music from iPad. Please help!!!

    I Need help changing my name on lipad and iPhone to sync. I have two different name1 is from my laptop and the other is from iPad ,so I can't sync iTunes. Please help!!!!!!

    Plug the iphone in and go to the music tab in the iphone,not your itunes library.There will be a button in the borrom right that says autofill. Click that and it should thransfer all your music. It worked for me,and i had the same problem.

  • I need help changing my iTunes password

    I need to change my iTunes password but I am unable to answer either of the security questions.

    I don't get how 2 do this I'm in the us we'll I was then I came 2 Austria now I'm back in the us someone helllppp meee
    Please    

Maybe you are looking for