AppleScript: Select the audio files in the Finder, to create playlist

So, I have modified this Applescript courtesy of WoodenBrain and tried to deconstruct to use. What I need to do, is to be able to select the audio 3-4 files in the Finder, then contextually, select the function "Add to iTunes Playlist", that iTunes ask me for the name of the playlist, create playlist and add files. The script below which realizes, but has an additional step that allows you to select available playlists. I want to remove and don't have iTunes adds the music files to the newly created playlist.

I know that the solution is somewhere between the block of choice, but I can't seem to get the name of the created playlist and use the the_plvalue. Any ideas?

on run {parameters}

Try

Activate application "iTunes."

say application "iTunes."

define newFile to the text returned by (display dialog box default response "Playlist name?" » »)

make new user playlist with properties {name: newFile}

set the_playlists to the of each user playlist whose name friendly special is none and smart is false

the value the_playlists to iSort (the_playlists) to me

(* to remove the next block *)

say me to the value the_choice to choose from the list the_playlists with prompt "Add selection to this playlist:

If the_choice is false then error

the value the_pl to issue 1 of (every playlist whose name is the_choice)

(* end choice block *)

activate

the value reduced to window 1 to false

the value cn to (number of points in entrance)

Repeat with I have from 1 to cn

say application 'Finder '.

game of the_item to (point as aliasentry, I)

If I = 1 then set iname to the name of the_item

end say

Add the_item to the_pl

end Repeat

end say

end try

back entrance

end run

on iSort (_list)

_length set to length of _list

If _length > 1 then

Repeat with I have since 2 to _length

Set temp to the point I of _list

set j to i - 1

Repeat while (not (j = 0)) and (point of _list j > temp)

set agenda (j + 1) of _list to the point of _list j

set j to j - 1

end Repeat

set agenda (j + 1) of _list to temp

end Repeat

end if

return _list

end iSort

on is

Hello

Put the output of the command of playlist make new user in a variable.

No need of a loop, the add command takes a list of files.

-----------------

the term {parameters}

Try

Tell application "iTunes".

activate

the text returned by the value tNom (show the default dialog response 'The Playlist name?' » »)

the value of the_pl to the new playlist user with properties {name: tNom}

Add entry to the_pl

reveal the_pl - show the new playlist

tell the end

try to end

Back entrance

end of race

Tags: Mac OS & System Software

Similar Questions

  • Captivate 8 Drag and Drop - selection of Audio files for interaction

    I see where the box is for the selection of audio data to play (Drag and Drop/Options/Interaction properties). I want to select the audio file that will be used, but I don't see where the new place is to select and add the file. I checked the training videos that came out this week, but add the audio was not included. Help appreciated.

    Hello

    Choose an audio file,

    Select the Drop target in the scene. Drag and Drop Panel-> Format-> behavior Snap tab, you can find the Audio menu down.

    Custom Audio file can be selected by clicking Browse next to the drop down.

    Kind regards

    Alexis

  • Songs to keep the abandonment of created playlist

    Operating system is Windows 10 with the latest version of ITunes (always be updated later) software. Created playlist "My Favorites" and establish criteria to add songs to the playlist after 5 pieces. Recently noticed songs were down everytime I open ITunes on my laptop. (Playlist gives the number of songs) Why is this? Checked my settings and nothing has changed.

    If you can post a screenshot of the rules of your Playlist, maybe someone can identify what is wrong.

  • Discs CD - R burned with the Finder in Yosemite are unreadable by other players of CD despite the burned music files individual, .aif format. When it is burned with iTunes, all right. Any ideas?

    Discs CD - R burned with the Finder in Yosemite are unreadable by other players of CD despite the burned music files individual, .aif format. When it is burned with iTunes, all right. Any ideas?

    A CD to use in an Audio CD drive must be formatted as an Audio CD.

    Finder cannot create an audio CD, instead, it creates a data CD.

    Therefore, use iTunes to create create an Audio CD.

  • How the hyperlink to an audio file?

    I have associated my ebook PDF I create audio files. I want to create links to the records and trying to find a way to do it.

    (I don't want to insert the audio directly in the document, and I would like readers to be able to use the PDF without the need to have Acrobat, so that they can only use a standard PDF reader).

    I tried to create a hyperlink to a file, but so far it has not worked. I've created a hyperlink to an audio file on my desktop, but when I export to PDF and then click on this link, it does not work, I just get a "blurp" sound that my computer generates when an operation is not possible.

    Could someone point me in the right direction with this?

    I think so, but this isn't the kind of work I do. I know, however, that the ID uses absolute links, so you need to link to the final House of the file, not a local copy on your hard drive. A link to a file on a CD or DVD that you want to didtribute is delicate and likely to do in Acrobat, but it's something for someone who does this kind of work to answer.

  • A user selected audio file cannot be read

    I have problems to get a selected user audio file to play. I know that you can not play the RIM supplies those, but here's what I have:

    Class cl = Class.forName("bb.cen.CallEnd");InputStream input = cl.getResourceAsStream(soundToPlay);
    
    m_player = Manager.createPlayer(input, "audio/mpeg");m_player.realize();m_player.prefetch(); 
    

    soundToPlay is obtained from:

    soundToPlay = "file:///" + oData.getStringElement(OptionsData.USERSOUND);
    

    OptionsData.USERSOUND is obtained from a form popup of file selection using getFile().

    It is usually something like /SDCard/Blackberry/ringtones/sound.wav

    Whenever I run it well, I can select the file, but I always get a

    CAFETERIA: impossible to find...

    I know I'm getting this because getResourceAsStream returns null.

    How to do that it returns is not null?

    getResourceAsStream Gets a file that is integrated with a RIM approx. soundToPlay goes to a file location, try from soundToPlay in Manager.createPlayer instead of trying to get * beep * an embedded resource. If it is an embedded resource, you must access it as you would with Class.forName, only you pass the string in getResourceAsStream.

    Hope that makes sense.

  • Audio files imported into iTunes shot in Streaming Audio

    I use iTunes to organize the audio files I've created with GarageBand and create my own albums.  iTunes game allowing to synchronize these albums to my four Macs without problems.

    It worked until I signed up for the trial of AppleMusic plus iTunes game.

    Suddenly the iTunes library on three of the four Mac Sync showed a number of my own songs like 'Apple Music Audio File'.

    When I create a smart playlist with the rule:

    • Artist contains Leonie and iCloud status is Apple music

    I find 17 of my own creations that are all of a sudden Apple music.

    And after the end of the trial of AppleMusic I couldn't play them any longer. When I tried, I got the prompt to renew the composition of Apple's music.

    turingtest2 helped me to clone a good library for my other four Macs and start over.

    This helped for a month or two, but now more and more my own audio songs are transformed into 'Streaming audio' for a change, is no longer Apple Audio music file with the iCloud status 'pending '.

    I use OS X 10.11.5 on every Mac, with the new iTunes.

    Should I try to restore the iTunes Library again on three Macs synchronized from a good copy master?

    EEK. I've seen iTunes decided to process the files on the local network who have been referred by a UNC path as internet stream before today. What I don't understand is how an internet stream is supposed to get loads of iCloud.

    I think back to a well known version of the library is the only way to solve. What do you see as the location on the tab file for one of the audio tracks?

    TT2

  • How can I add audio files for my adobe muse Web site?

    I'll be weekly by adding audio files to my muse site created and I wanted to know how to do. Any help would be greatly appreciated. Thank you!

    Bob

    You must add the files for download on your site of Muse, the option of the file menu.

    After you have added files, you can link the files with any text or page content. You can use the same method to load audio files every week.

    Thank you

    Sanjit

  • How can I force the Finder to show all files in a folder of Capitan?-instead of always having to click on "Show all" to see the full selection of files.

    How can I force the Finder to show all files in a folder of Capitan 10.11?-instead of always having to click on "Show all" to see the full selection of files.

    It is not often that I said ' what are you talking about"but" what are you talking about? "

    I do not know of all "show all" in the Finder. Can you provide a screenshot?

  • Photo Story 3 cannot join the audio of the video program, get the error message, even when you try to select the files audio mp3

    Photo Story 3 impossible to join several video (audio) to program songs that has been created, an error message that it cannot accept the format audio, even when you try to select the files mp3 audio.

    Hi BeverlyHeuer,

    I suggest that you convert the music file to convert it into .wav format and check if you can contact.

    Photo Story 3 for Windows: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows-XP/help/digitalphotography/photo-story-FAQ

  • Photoshop CS3 can not save a file when it is selected in the Finder

    Photoshop CS3 can not save a file when it is selected in the Finder: "cannot save ' [filename] ' because the file is already in use or has been left open."

    I am running Photoshop CS3 on Mac OS X Yosemite 10.10.5.

    Is there one solution other than to get a new version of Photoshop? It is quite annoying to have to switch to the Finder and deselecting the file that I work with.

    Well, I specifically asked if there was one solution other than to get a new version of Photoshop.

    I found a way to do so; Open the file does not by double-clicking, but by right clicking. He let the file not selected in the Finder, at least in list view or column.

  • Icon "Are the selected markers to separate the export audio files" is grayed out outside in the markers window. The titles show starts but no end of times, and yet time is calculated.

    I have a large wav file to finish securities as a mixer and inserted the CD markers where I want the marked pistes. Icon "Are the selected markers to separate the export audio files" is grayed out outside in the markers window. The titles show starts but no end of times, and yet time is calculated. Why can't I export those items marked as separate files?

    You must make the markers of track in regions for the Export of work function. Make sure that you have placed a marker at the end of the file, as well as at the beginning of each track. Then select all the markers in the marker list by left clicking the first then shift left click on the last. You can then merge markers in the channels using the comb as icon (3rd from left) at the top of the list of markers. You will then be able to export the lines marked as separate files.

  • Change the preview image of audio files (no icon) in the Finder?

    I know that this is easily done in iTunes, simply by changing the 'work' of the song.

    But I need to do it outside of iTunes, and I need to change the preview image and not the image of the icon.

    Many tutorials show how to easily change the icon of a file, but I found nothing on the change in the preview...

    As said, I need to do it in the Finder, or perhaps with Quicktime? I don't know how I can use it, if necessary.

    I need to have the work I want already in the file before you import it into iTunes, regardless of the reason for which I won't get into that.

    You can use a tag editor to third party such as Meta-z for the files to m4a format.  I would recommend the Rage of free media now, but I can't find a download link works.

  • Windows Media Player-how add audio files to the existing selection

    Editing of existing playlist in Player 12 - great pain

    In previous versions of media player, I could drag a song to a windows explore Panel directly in a playlist. so adding media was a nod to a playlist. Now, you must open it in the game Panel, add media, and you MUST CREATE a NEW NAME FOR THE list of READING which is ABSURD! In other words you can not change the playlist, click SAVE, and the playlist that you work is registered. You should always create a NEW name. What I do is add a '1' to the old name, create the NEW name, and then I have to go back and remove the old list. Once again. It is ridiculously heavy. Can Microsoft fix this? Everyone is significant pain is?

    Original name? If you change an unregistered playlist, then it doesn't have a name yet. It is quite normal that you must enter a name when you click on save the list for the first time. The next time you save, you will not have to enter a name more (because then it's not playlist not registered).

  • How can I copy the list of names of files in the finder and set the Clipboard filenames separated by commas?

    Hi guys, I was wonder if anyone can give me a hand with a script.

    I need to be able to paste a list of file names of the files as follows:

    0001.jpg 0002.jpg 0003.jpg 0004.jpg

    At the moment, if I select the files in the Finder, copy to the Clipboard and paste them in TextEdit, they are like this:

    0001.jpg

    0002.jpg

    0003.jpg

    0004.jpg

    I found a similar but slightly different script and I don't know how to change it. Here it is:

    Define extension_list to {"jpg", "" JPG","jpeg","JPEG"}

    the value cbNames (Clipboard text) paragraphs

    Set csvNames to {}

    the tid value delimiters to point to the text of the AppleScript

    the text value of the AppleScript point delimiters ".»

    -now, make a list of names without extensions

    Repeat with the names in cbNames

    If the point 2 of the text names is extension_list then

    copy of text 1 of names at the end of csvNames

    end if

    end repeat

    Journal csvNames

    -now the filenames as comma CONCATENATE string separated

    the text value of the point delimiters AppleScript «»

    csvNames value cross-as text

    the text value of the point AppleScript delimiters tid

    There is an easier way. Open a TextEdit document and paste the list in. Place the cursor at the end of the first item and drag it to the start of the second.

    Press on + command + c to copy and then command + f to bring up find it. Press command + v (do not click in the first search field). Check the 'Replace' box, click in the field replace, and then type a comma and a space.

    Click 'All' and then 'done '.

Maybe you are looking for

  • Funky problem continuously with a specific application

    This problem could be related to how this app was designed, but I thought someone here might know a hardware fix. Streaming of any application to airports is easy-peasy, but this particular application of the Apple TV streaming is a real struggle - b

  • HP-15-p051us: card Wifi access

    I need to update my wireless card. How to access the card? I guess that via the keyboard, but do not understand how to remove it. Someone sent me a link to youtube video, but my keyboard seems to be a solid unit with the top cover.

  • Problems with multicast UDP passage from 2009 to 2010

    I have Windows 7 laptop computers of switching and reclassification of LABVIEW, LABVIEW 2010 2009. One of the vi, I developed in 2009 works fine on the old laptop, but with the new laptop and LABVIEW 2010 the UDP Multicast open read-only block throws

  • the merger

    OK, so if these 2 r merger... What about emails? can we always email hotmail account or not? Can we still keep the same email address?

  • Need help with fixing drop bar down in windows Explorer

    Everytime I open Explorer windows from the desktop or the start menu, it opens. But the address bar at the top keeps popping up in. It won't let me open anything.