Adding prefix to the dropped onto the droplet file names

Hi, I am trying to adjust apple sample script to rename bunch of files dropped on a droplet instead of all files in selected folder. Here what I have and it doesn't give me list of the dropped files:
Add Prefix-Suffix to File Names
This script is designed to add a prefix or suffix to files in the front window of the desktop.
If no folder windows are open, the script will effect items on the desktop.
Copyright © 2001 Apple Computer, Inc.")
*on open draggedItems*
try
* tell application "Finder" to set the source_folder to (container of the draggedItems) as alias*
* on error -- no open folder windows*
* end try*
* set the prefix to "front_"*
* set the item_list to list folder source_folder without invisibles*
* set source_folder to source_folder as string*
* repeat with i from 1 to number of items in the item_list*
* set this_item to item i of the item_list*
* set this_item to (source_folder & this_item) as alias*
* set this_info to info for this_item*
* set the current_name to the name of this_info*
* if folder of this_info is false and ¬*
* alias of this_info is false then*
* set the newfilename to the (the prefix & the current_name) as string*
* my setitem_name(thisitem, the newfilename)*
* end if*
* end repeat*
* beep 2*
*end open*
*on setitem_name(thisitem, newitemname)*
* tell application "Finder"*
* --activate*
* set the parentcontainerpath to (the container of this_item) as text*
* if not (exists item (the parentcontainerpath & newitemname)) then*
* try*
* set the name of this_item to newitemname*
* on error the error_message number the error_number*
* if the error_number is -59 then*
* set the error_message to "This name contains improper characters, such as a colon (:)."*
* else --the suggested name is too long*
* set the error_message to error_message -- "The name is more than 31 characters long."*
* end if*
* --beep*
* tell me to display dialog the error_message default answer newitemname buttons {"Cancel", "Skip", "OK"} default button 3*
* copy the result as list to {newitemname, button_pressed}*
* if the button_pressed is "Skip" then return 0*
* my setitem_name(thisitem, newitemname)*
* end try*
* else --the name already exists*
* --beep*
* tell me to display dialog "This name is already taken, please rename." default answer newitemname buttons {"Cancel", "Skip", "OK"} default button 3*
* copy the result as list to {newitemname, button_pressed}*
* if the button_pressed is "Skip" then return 0*
* my setitem_name(thisitem, newitemname)*
* end if*
* end tell*
*end setitemname*
Thank you very much for your help.
Yulia

The original script quite clearly looks for the parent folder of the dropped items and iterates through the contents:
tell application "Finder" to set the source_folder to (container of the draggedItems) as alias
If you don't want that, just eliminate that part of the code and use a simple loop based on draggedItems:
on open draggedItems
  set the prefix to "front_"
  repeat with this_item in draggedItems
    set this_info to info for this_item
    set the current_name to the name of this_info
    set the newfilename to the (the prefix & the current_name) as string
    my setitem_name(thisitem, the newfilename)
  end repeat
end open
(You'll still need to include the on setitemname handler since that's the bit that does the actual rename, but I don't see a reason to change that.

Similar Messages

  • Some Apple Loops refuse to index when dropped onto the Loop Browser

    I'm hoping somebody has a fix for this odd problem. Some of the Apple Loops which came with version 1.0.1 refuse to index via the loop browser.
    First off, I had to re-install GarageBand 1.0.1 after an invalid library error message appeared after upgrading to Tiger. The re-install wasn't completed totally and it did the same thing on 2 attempts. The next error message was: Apple Loops are missing, or something to that effect. I had to install the Apple Loops found in HD->Library->Application Support->GarageBand by dropping them onto the GarageBand Loop Browser at the bottom of its window. It indexed them, they appeared, and I was happy.
    Today, for some reason, I looked through the loops folder mentioned above and noticed about one third of the loops do not appear in the Loop Browser, naturally some really neat stuff is missing! So I decided to drag & drop these Apple loop files onto the browser individually. It says it's indexing them, althought the guitar icon in the dock jumps while doing so, but they never appear and don't show-up in the search box either. They can however be dropped onto the Timeline from the Finder and will play as a music file. The problem is that I cannot listen to them from the loop browser for easy selecting when arranging.
    Is there any way to get these stubborn Apple files to appear & play in the Loop Browser? I was hoping they could be added via the Timeline to the Loop Browser, but have had no success. Also, I tried the Apple Loops Utility thinking maybe the appropriate tags were missing, but can't figure out what is missing, if anything.
    Thanks in advance for your help.
    Barb
    iMac G5 20   Mac OS X (10.4.4)  

    The Loop Browser filters what it displays by only showing loops in the same Time Signature as the song you've created, and within 2 semitones of the Key your song is in.
    You can change the latter by tuning off Keyword Browsing in GB's preferences.
    --HangTime [Will Compute for Food] B-|>

  • Does it bring any harm or damage to the iphone 4s if let say there is a drop of water drop onto the iphone 4s RECEIVER??

    does it bring any harm or damage to the iphone 4s if let say there is a drop of water drop onto the iphone 4s RECEIVER??

    Water and electronics are a bad combination. I've seen phones get a few drops of water on them and never work right again. Mind you, I've also seen phones (old flip phones) go through both washer and dryer and continue to work for years.
    Does your phone still work? Are you experiencing any problems? If the answer to both of those questions is no, you should be okay.

  • I've got a  MacBook Pro 1TB HD, the drive was damaged (probably dropped) after I formatted the new drive I was able to get the OSi onto the drive and it's now up and running..But prior to removing the old HD I was able to run CloneZilla to map t

             
        I've got a  MacBook Pro 1TB HD, the drive was damaged (probably dropped) after I formatted the new drive I was able to get the OSi onto the drive and it's now up and running..But prior to removing the old HD I was able to run CloneZilla to map the drive. The problem I'm having is getting the files and documents back on the new HD.
       I created a folder on the desk top and moved all the files and docs onto it, ( files / docs was originally burnt on a DVD ).  I'm not sure A) how to open the specific files B) which files to extract C) Is it as simple as drag and drop...
       Hope you're able to understand my problem and offer some suggestions, in advance thank you for your time and effort...

    Hi, Steve -
    Yes, the CD-ROM drive must be jumpered as Master in order for it to be bootable.
    Your G4 (PCI) should have two built-in IDE buses - one is usually assigned to the CD-ROM and Zip drives, and the other is used for hard drives. If you have the hard drive connected to the same bus as the one the CD-ROM is on, try switching the hard drive to the other bus.
    Set the hard drive's jumpers as Master.
    Exception - if the hard drive is a Western Digital, it may have a third position, Single, which must be used when the drive is the only device on the bus.
    Note - Cable Select jumper settings will not work on a G4 (PCI).
    Edit - -
    Startup Manager, which is what booting with Option held down invokes, is not available on a G4 (PCI).
    Article #106178 - Startup Manager: How to Select a Startup Volume
    Firewire Target Disk Mode is limited on a G4 (PCI) - it can be the Host machine, but not the Target machine.
    Article #58583 - Firewire Target Disk Mode
    Relatedly, a G4 (PCI) can not boot to firewire drives, although it can use them for storage.
    Article #58606 - FireWire Booting

  • ITunes cannot transfer movies bought from the Store onto the iPad.

    I have an iPad Mini and iTunes cannot transfer movies bought from the Store onto the iPad.
    'Manually manage videos' is ticked but then after each sync attempt it goes back to being unticked.
    'Sync only checked songs and videos' is also ticked and remains so.
    When I choose the movies to put on the iPad, it gives me an indication of how much space I have (enough), lets me sync and then goes back to zero.

    thanks jolieteddie, 
    FYI, I searched the side pane here after asking this question.  It seems someone gave an answer that worked for me.  I could not drag and drop a pdf from the desktop into iTunes or the Ipad2 directly for whatever reason.  However in iTunes on the main menu under Files>Add, I could navigate to the desktop and add the pdf that way, then sync Books with the iPad. This worked!
    I've attempted in the past to drag and drop videos, etc into iTunes and the iPad with no success. Somehow it never occurred to me to add them this way. Doh!
    Good tip.

  • I updated firefox to 4.0 and then to 5.0 and it doesn't look like it is supposed to, I still have the navigation tool bar at the top of my page and the drop down boxes too (file, edit, view etc). Why is this an how can I get the proper new versions?

    When I updated firefox to 4.0 the only things that really changed were a couple of buttons and the position of the tabs, the blue navigation bar and the drop down menus for file etc didn't change at all.
    My computer also freezes when visiting certain websites with firefox, not Every time I visit but frequently. The websites are usually commonly visited websites (Gmail, stuff.co.nz) and don't do it when I am using internet explorer or another computer. This started when I downloaded the upgrade.
    I use a net-book with Windows XP.

    To get the new style UI you need to hide the menu bar. To do that in the View menu select Toolbars, then click on the "Menu Bar" entry.
    If you need access to the menus you can press either Alt or F10 to temporarily display them.

  • I have a new iMac running iTunes 10.4 in OS 10.6.8, and a new Mac Air running iTunes 10.4 in Lion.  I was able to transfer all my music etc. from the iMac onto the Air, but cannot figure out how to get the Playlists from the iMac to the Air.  iTunes Help

    I have a new iMac running iTunes 10.4 in OS 10.6.8, and a new Mac Air running iTunes 10.4 in Lion.  I was able to transfer all my music etc. from the iMac onto the Air, but cannot figure out how to get the Playlists from the iMac to the Air.  iTunes Help says File >Library >Export playlist and choose XML, or to save a copy of all your playlists, File > Library > Export Library, "the Exported info is saved in XML format."  Then it says, "to import an iTunes playlist, File > Library > Import Playlist".  Now I am assuming I do that import part on the Air, but when I try it doesn't recognize anything that can be imported - what am I missing??? Aside from a clue...

    Thanks, Jim, for taking the time, but the reply is unfortunately vague in the exact area of my confusion!  "you need to copy that file to your new computer..."  Well, the Import/Export instructions make it seem as if the two computers should be able to communicate this file thru wifi, but that's the linkage I can't seem tocreate with Import/Export.  Should I instead email a copy to myself (thats what applecare suggested)?  Copy it to and from a thumb drive?  But then place the file where?  And the article was helpful, but should I be trying to move the Library file or the Library.xml file (as iTunes Help suggests)?  Sorry to be so clueless about it...I suppose I buy Apple in the hopes of not having to think about this stuff, which approach seems not to be serving me well. Thanks again for your time!

  • I was going to install Rosetta Stone Spanish onto my Macbook but am concerned about it taking up space on my 2GB hard-drive.  I have an external WD hard-drive; is it possible to put the application onto the external hard-drive to save space on my mac?

    I was going to install Rosetta Stone Spanish onto my Macbook 10.6.7 but am concerned about it taking up space on my 2GB hard-drive.  I have an external WD hard-drive, and I was wondering if it is possible to put the application onto the external hard-drive to save space on my Mac? 

    I think you're confused about how much hard drive space you have.  You probably have 2 GB of RAM...  there hasn't been a Mac shipped with only a 2 GB hard drive in a while.  At the bottom of any Finder window, how much space is available?
    If you're actually running low on space, you should move documents to the external drive, since many applications want to be on the system drive.

  • Is there any way that I can put the 600 songs that are stored on my old PC onto my new PC?  My iPod has the 600 songs on it but my iTunes will not let me add the songs onto the iTunes on the new computer.

    Is there any way that I can put the 600 songs that are stored on my old PC onto my new PC?  My iPod has the 600 songs on it but my iTunes will not let me add the songs onto the iTunes on the new computer.

    Yes.
    You should have copied everything from the old computer to the new one.
    Type "move itunes library" into the google search bar

  • HT201269 I backed up my 3GS using iTunes. I then restored the file to my new 4GS. Then I synced the apps onto the 4GS. Then I downloaded 2 custom ringtones, and attempted to sync them onto the 4GS, but it says "This Library is already synced with another

    I backed up my 3GS using iTunes. I then restored the file to my new 4GS. Then I synced the apps onto the 4GS. Then I downloaded 2 custom ringtones, and attempted to sync them onto the 4GS, but it says "This Library is already synced with another phone, and if you try to sync, you will lose all of the information on the iPhone." I am a Windows user. This Sync process is VERY confusing.

    How can I possibly get these two new ringtones onto the iPhone without wiping out everything else on the phone? This Sync process is nuts.
    I have Backed Up the phone twice. Why would iTunes try to wipe out the phone?

  • In trying to transfer iWeb pages (not uploaded) to another computer I went into the library and transferred the domain onto the desktop. Disaster! On opening iWeb all previous (uploaded) sites have disappeared. Help!

    In trying to transfer iWeb pages (not uploaded) to another computer I went into the Library and transferred the domain onto the desktop. Disaster! On opening iWeb all previous (uploaded) sites have disappeared. On opening the domain all I can recover is the many component parts, and when unzipped the code. Help! Mike

    Code in a domain file - really?  That is not possible because the domain.sites file does not contain any html or css code at all - the domain file is your iWeb data file and you won't see any code until you publish your website.
    If you can see html code, then you have the wrong file and it is a published version of your site which iWeb can do nothing with - iWeb has no import facility so cannot open any html files.
    Go back and ensure that you have the correct domain.sites files that can be found under your User Library/Application Support/iWeb/domain.sites and if you have Mavericks then you need to go to Go and press the alt key to reveal your hidden User Library, so that you can then get to Application Support and then iWeb and then your domain.sites file.
    You will also need to go and download either DomainCracker or iWebSwitch which allows you to open individual domain files under Mavericks, because from Lion onwards, you cannot open individual domain files.
    Also, it says that you are still using iWeb 08?  If this is so, you'll either need to upgrade to iWeb 09 by going to Amazon and purchasing the iLife 09 or 11 boxed set, both of which contain iWeb 09 or you need to switch to newer software that is actively being supported and developed such as EverWeb (http://www.everwebapp.com).

  • HT1349 i need to put the documents from the mac onto the mac book air

    i need to put the documents from the mac onto the mac book air.  How to I transfer my mac documents and music information to my macBook air?

    You have many options.
    Network the two Macs
    Use a Thunderbolt or FireWire cable and use FireWire Target Disk Mode
    Use Setup Assistant when you first set up a new Mac, or Migration Assistant at any time thereafter
    Use an inexpensive USB flash drive
    Email documents and files to yourself
    Use Dropbox or similar service
    Those are just a few. If you explain further or reply with the model of your "older" Mac and which OS version it is using, more specific information can be provided.
    You may find Apple Support Communities contributor Pondini's OS X tip useful: Setting-up a new Mac from an old one, its Backups, or a PC

  • How do I force iTunes to put my contacts from the computer onto the phone?

    How do I force iTunes to put my contacts from the computer onto the phone? Multiple synchs and a restore did not work and neither does clicking the advanced setting "replace this information for this iPhone." Earlier this year I tried syncing via the cloud but only ended up with 3 different calendars, bookmarks and contacts on my devices so now I only sync via iTunes and USB.

    i followed the instructions to manually manage songs and playlists.
    Drag playlists from iTunes in the Source to the iPod.
    If you want to delete a playlists from the iPod, in the Source in iTunes, click th eDisclosure triangle in front of the iPod name to display the playlists on the iPod.
    You should edit the playlists in iTunes and then drag them to the iPod.
    If you edit them only on the iPod in iTunes, and have to reload your iPod, the playlists will disappear.
    what do i need to do to save the music from my nano to my hard drive
    The songs should be in iTunes already.

  • Can a user download something from the internet onto the IPad, without an app or a computer?

    Can a user download something from the internet onto the IPad, without an app or a computer?

    You download apps from the Apple AppStore.
    Music is from iTunes
    For other types of downloads, try iCab.
    Robert

  • HT3819 When I sync my iPod some of my purchases from iTunes transfer, but some do not.  When I try to drag the songs onto the iPod icon it shows the 'crossed out' symbol and won't move them.

    When I sync my iPod some of my purchases from iTunes transfer, but some do not.  When I try to drag the songs onto the iPod icon it shows the 'crossed out' symbol and won't move them.  I've tried synching from multiple computers that are all connected with home sharing but it still didn't do the trick.

    Installing iTunes does not cause content to magically appear on the computer.
    Your media is only where you put it.
    iOS devices are not backup devices.
    Copy the media from the old computer to the new computer.

Maybe you are looking for

  • How to find R/3 table  for FI and PS Datasources

    Hi, Can anyone tell me that how can we find SAP tables for FI and PS datasources in BI. Please provide information as it is urgent. Points will be assigned Thanks Shanthi

  • 10.1.3 Error - ViewCriteria not working in a Sql based VO

    I created a ViewObject based on a query (I mean without entities). I tried to apply a viewcriteria (also using tester Query by example) but nothing changed. Is it a known bug ? Is there some workaround ? Tks Tullio

  • Apps won't update.  Help?

    My Apps download, start to install and immediately stop.  It then says I still need to update the apps.  Any ideas?  Thanks.

  • Importing Playlists from Windows Media Player

    I was wondering if there was any way I could transfer all of my music from my Windows Media Player library, to my iTunes library. I have tried import on the "File" button on iTunes, but it didn't work. Dell   Windows XP  

  • NIK Plugins Killed Trial?

    For one day after installing a Trial version of Photoshop CS6 for Mac it worked fine. The next day (today) I installed my NIK/Google Plugins Collection and now Photoshop won't open and says "Your Trial Has Expired" and just offers to let me purchase