Edit Long file names

I have a Finder folder containing numerous files that have very long file names, all of which have identical long strings within the name, for example: X A Y.aiff where A is the common portion of the file name that I wish to delete. There could be as many as 48 files of this kind within a folder. Can someone suggest an Applescript that would strip out the A from all of the file names.
Thanks.

The following script should do what you are asking for:
*set portionToDelete to "some text"* -- insert your own text here
*set L to length of portionToDelete*
*set F to choose folder*
*tell application "Finder"*
*   set theFiles to files of F*
*   repeat with thisFile in theFiles*
*      set oldName to name of thisFile*
*      set P to offset of portionToDelete in oldName*
*      if P > 0 then set name of thisFile to text 1 through (P - 1) of oldName & text (P + L) through -1 of oldName*
*   end repeat*
*end tell*
Message was edited by: Pierre L.

Similar Messages

  • Time capsule won't allow long file names

    Hello,
    I've managed to solve every problem I've had through searching other people's forum posts - apart from this one.
    I've got a MacBook Pro and Dell PC (Windows 7) connected to a Time Capsule. Soon I'll happily bin the Dell but am moving gently to Macs while I learn about them.
    The Mac connects happily to TC and will allow creation/editing of long file names.
    The Dell allowed this for a week, but now doesn't like it. When I go to the Time Capsule/Data folder in Windows 7 Explorer, I can copy over files with long names, but I can't create them, nor can I change any existing file/folder names on TC to be longer than 8 characters.
    I've searched and searched online and can't find anything that would suggest why this is happening.
    Thanks in advance,
    Adrian

    Tried DHCP & NAT but had the double NAT issue.
    If you got the TC working and had double NAT .. sorry but the TP-Link is exactly the same.. you cannot distribute a single IP without double NAT.. the TC tells you it is a problem.. the TP-Link doesn't.. otherwise there is no difference.
    But it is important the double NAT is setup right.. ie you must use different ranges.. please tell us the IP you get from a directly connected computer..
    If it is 10.x.x.x then you should move the TC to 192.168. rather than default IP of 10.0.1.1 .. the TP-Link already will use 192.168.x.x. which might also explain why it works better.

  • Long File Names via smb ethernet

    I'm trying to transfer files from my old Vista box to my new MacBook Pro. I'm set up with a direct ethernet connection and using smb protocol. Problem is I cannot transfer files with long file names. Only a problem when you consider that I'm transfering about 400 gigs of files at a time... it would be rather tedious and take me a considerable amount of time to go back and shorten so many file names. Is there any way around this? Any help would be greatly appreciated.

    maybe try zipping up the files as a folder or something. SMB follows similar rules the the older FAT32 based windows oses followed back in the day. If the zipping doesn't help, then you'll have to rename the files.
    you might try a renaming utility to look for files with blank spaces or the following characters:
    "SMB, files can’t use the following characters: ” / \ [ ] : + | = ; , * ? and space, and the period ‘.’ can only be used once."
    http://www.rossolson.com/dwelling/2007/03/notes-on-nas-and-mac-os-x/
    Message was edited by: kmac1036

  • Long file names in spotlight

    This is not an issue so much as a comment about how OSX handles (or I should say ignores the possibility of) long file names. I will use spotlight because it is the worst offender, but I also routinely run into this in finder (although it is not as bad as I will discuss later). The issue is this, we use pretty long file names at our company because we have a lot of files that are very similar and a lot of files with version numbers as they are edited and reviewed. These can be 40-60 character names. This issue is that when you go into spotlight and start searching, I often get a totally useless list of identical files because the version number or distinguishing text is after character 30ish. A great example is shown in the picture below.
    I think spotlight is just about the most useful tool in OSX, but this only makes it more challenging when I run into this computer because I have to remember how to use a computer without spotlight. Finder solves this problem two ways: having expandable window width and but putting the ... in the middle of the file name and showing you the end. This is shown below:
    I can understand how the apple folks down want to have spotlight be an expandable window. But it seems like putting the ... in the middle of the file name would be a simple fix. Alternatively, the file names could scroll, the full name could be listed at the bottom of the window when highlighted, or any other number of fixes.
    Again, I am hooked on spotlight, so this isn't something that is going to drive me away from OSX, it just seems like something that was overlooked.

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Windows sharing long file names

    Just after a bit of advice with regards long file names with OSX/Win.
    I have a user that uses a mixture of SL and ML connection a shares on a Win 2008 R2 server.  They had some issues a while back with long file names ( I think folder depth more than anything) and a previous engineer installed ExtremeZ-IP.  However ever since they've been having random file permission issues.
    I'm keen to remove the ExtremeZ software as I see it as an extra piece of management and failure and with the news of Apple dropping AFP, makes sense to lose it when possible.  I do have other users using OSX and Win 2008 servers with no 3rd party software and not having any issues.
    I'm thinking that the original problem was with using AFP not liking the Win file names and instead of moving to SMB, the software 'fix' was used. I feel that removing this software and forcing the clients to use SMB, will hopefully resolve the permission issues and have no implications on file names.
    I would be grateful if someone could shed some light or thoughts on this if anybody has similar experience.

    I suspect they are connecting to the server using Samba and you're using afp ?

  • Long file names-won't copy

    how can i turn off my macs irritating annoyance at not wanting to copy files with long file names ? some of these files come straight from CD's, so I can't change the filenames unless I went to a PC, copied them, changed the name and then copied them to my Mac. that is way too much to do.

    Hi, Ted.
    It would also help to know if you're trying to copy the files to your Mac's internal hard drive(s) or an external drive, such as a FireWire drive. If an external drive, knowing the format of that drive also helps.
    Along the lines of your question:
    • The maximum length for a file name in Mac OS X is 255 characters. See Mac OS X: About Long File Names.
    • However, I've seen cases in some Carbonized applications, i.e. those written originally for Mac OS 9 and ported to Mac OS X using the Carbon developer tools, that still insist on enforcing the 31 character limit of Mac OS 9. That is an issue with the application, not Mac OS X, and occurs when you attempt to File > Save or Save As... a new file created in that application.
    • Certain characters are prohibited in Mac OS X file names. See "Mac OS X 10.4 Help: I can't use some characters in file and folder names."
    • Likewise, if you plan to share files with PCs running Microsoft Windows, avoid Windows-prohibited characters in the file names: see "Mac OS X 10.4 Help: Copying files to a Windows computer from a Mac stops."
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How can I edit the file name of the home page?

    How can I edit the file name of the home page?
    Gr Ammani

    I have a similar issue with regards to the filename...
    When I navigate to my website, it doesnt work unless I actually type the filename at the end of it. Example: type in "www.whitelion.com" (this is my real domain name) and it doesnt work. When I type in "www.whitelion.com/index.html" then it works.
    This is obviously inconvenient because my clients will never know to add the filename to the end of the site.
    Is there any setting or way to get the page to appear by just typing the original domain name without adding the extension?
    Thanks,
    Emelia

  • Destination file characters too long (File names) , while copying from one external to another

    I have a external my book fat32 formated and a new mybook ntfs formated external as well.  Now when I copy my files from the fat32 to the ntfs external all files copy fine but some give that destination location file characters are too long, meaning that the file names are too long.  Now I could change the file names but that would conflict with programs that need that file name.  I am using vista ultimate and would like to copy all the files over from the fat32 to ntfs so I can reformat the fat32 to ntfs.  The files got on the ntfs from a simple drag and drop from my IDE NTFS internal hard drive.
    I hope you guys to tell me what to do.
    Thank you :)

    Here's the fix....for error message "your file name is too long to be copied, deleted, renamed, moved" :
    1.   problem is this: the "file name" has a limit on number of characters.....the sum of characters really includes the entire path name; you gotta shorten it first (i.e, if the total number of characters in the file name + Path name are over the
    limit, the error appears).  The deeper your file folder sub levels are, the more this problem will come up, especially when you copy to a subfolder of a subfolder/subfolder of another path ...adds to character limit)
    2.  How do you know which combined file names + path names are too long if  you are in the  middle of a copy operation and this error pops up?  Some files copied but the "long files error message" says "skip" or "cancel" ... but not which
    files are the "too long" ones.  If you hit "skip" or "cancel" the "too long" files are left behind...but are mixed in with non-offender "good" "short name" files.   Sorting thru 1000s of "good" files to find a few "bad" ones manually is impractical.
    3.   Here's how you sort out the "bad" from the "good":
    4.    Let's say you want to copy a folder ..."Football" ...that has five layers of subfolders; each subfolder contains numerous files:
      C:/1 Football / 2 teams/ 3 players/ 4 stats/ 5 injuriessidelineplayerstoolong 
           There are five levels root "1 football" with subfolders  2, 3, 4 and lastly "5 injuries"
    5.    Use "cut" and "paste"  (for example to backup all five levels to a new backup folder):
           select "1 football" ....cut....select target folder....paste 
           ("cut" command means as the files are copied to the target destination, the file is deleted from the source location)
          Hint: avoid "cut" and "paste" to a target folder that is itself a sub/sub/sub folder ...that compounds the "characters over the limit" problem ...because the characters in the sub/sub/sub folder are included in the "file name
    character limit"...instead "paste" to a C:/ root directory.
           Suppose in the middle of this operation...error pops up: "5 files have file names that are too long"  Skip or cancel?
           select "skip"  ...and let operation finish
    6.    Now go back and look at the source location: since the software allows only the "good" "short name" files to be copied (and because you "skipped" the "bad" "Long name" files so they are not copied or deleted) ...all that remains
    in the source location are the "bad" "long name files" (because "good" ones were deleted from the source location after the "cut" operation...the bad ones stick out like a sore thumb.
    7.   You will find ....all that remains in source folders are: the "bad" "too long" files; in this example the "bad" file is in level 5:
          C:/ 1 football / 2 teams /3 players /4 stats /5 injuriessidelineplayerstoolong
    8.   select folder 5 injuriessidelineplayerstoolong (that's right...select folder, not file) gotta rename the folder first.
    9.  hit F2 rename folder..folder name highlighted...delete some of the letters in the folder name:
           like this:   5 injuriessidelineplayers  ....you should delete 'toolong'....from the folder name
    10.  then go into folder 5....and do the same operation ...with the too long file name:
            hit F2 rename file....file name hightlighted...delete some of the letters
               like this:  injuriessidelineplayers.....you should delete 'toolong' from the file name
    11.  Now..."cut and paste"  the renamed file to the target backup folder.  
    The Error message will pop up again if you missed any "bad" files....for example, it will indicate "5 files too long" ....then repeat process 5 times until you fix all of them
    12.     Finally, copy the target destination files back to the source location (when you are certain all source location file folder locations are empty) 

  • Edited video file name now cant open in other programs

    Opened a MPEG video file in HP MediaSmart video Main program and edited the file name. Now when I try to open the file it will not open in Windows Media player or my other video edit/programs.  I did not make a copy of the file or do I have a backup, it's the original.  How can I fix this?

    @Goonies_2015 ,
    Hello and thank you for posting on the HP support forums.  What I expect you have done when doing the change to the file and saving you ended up removing the .avi or .mpg file extension.
    So what you can try is to go to the file where ever it is located.  Copy the file then paste it.  Then rename the file whateveryouwant.avi or .mpg.  If this does not work then you may have edited it and saved the blank formatted file with no extension.  If that is the case I am not sure if you can recover it.
    Here are some links you can check out.
    How to Change a File Extension in Windows How to Recover Deleted Videos  
    Now the two links may not be exactly what you need but may have the answer when it comes to recovering video files.
    Thank you again for posting and have a great day.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

  • Long file name support on DVD??

    I'm not a hardware or software person, but one of our guys who is is having trouble getting a DVD in a V120 running Solaris 9 to consistently recognize long file names on DVDs that were created on PCs running XP with various combinations Sony and Memorex DVD burners and Nero and Roxio RecordNow software. Focus has been on the software and burners, but has anyone encountered the same problem and found something that had to be tweaked on the Sun side? If so please let me know of the fix so I can pass it on.

    It's a software issue.
    Windows uses the Microsoft Joliet ISO9660 extension to allow somewhat
    longer (unicode) filenames than standard ISO9660.
    But Solaris doesn't support the Microsoft Joliet extension. Solaris supports
    the RockRidge ISO9660 extention for long filenames (and posix support).
    Try to find a CD mastering application that allows to write RockRidge
    format CD/DVDs.
    E.g. the unix "mkisofs" utility allows to create ISO9660 filesystems with both
    the RockRidge and Joliet extension, so that you get long filenames on
    both unix and windows.

  • Can't view files with long file names?

    Hi, Im using Mac OSX 10.3.9 and I have a problem viewing files on a server that have long file names (i.e over about 20 characters) they do not show up on my mac but when viewed on a PC computer they are all there. Strange thing is though I have another mac on the same network running exactly the same operating system and version and files with long name can be viewed on that system ?? it is some simple preference does anybody know? Any help would be much appreciated. thank you.

    Hi, I tried accessing a test file that I have made up with a long name through a browser and through FTP and cannot see it on either one. I can however see it on the other Mac that I have access to that is running the same OS and version etc... and also this file can been viewed on the PC's that are around me....

  • Logic 7.2 - long file names?

    I read the messages from the few people who looked at the new 7.2 version at NAMM. Besides all the known and unknown features/bugfixes, does anybody know if they got rid of the 31 character filename limitations.
    OSX is out now for how many years?
    The strange thing is that GarageBand files supports 255 characters, , but it limits the EXS file names which it uses in its plugins:
    If you open the The CurchOrgan Software Instrument in GarageBand3, which is like a "EXS24 light", and click on the "Registration" popup menu then you see a list of EXS instruments which are located in the following directory: /Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Instruments/Church Organ
    You can place any EXS Instrument file inside that directory and it will show up in the "Registration" popup menu (after you restart GarageBand).
    OK. if I place now an EXS instrument file inside that folder and rename the file with a very long file name, it will show up truncated inside GarageBands Software Instrument.
    Does that mean that even in GaraBand3 there is still legacy code which doesn't support full 255 file names. And does that mean that the long filename support for Logic and especially EXS24 is still not implemented in Logic 7.2?
    G5 Dual 2.5G - 4.5GB RAM   Mac OS X (10.4.4)   Logic 7.1.1

    No, Logic 7.2 doesn't bounce and name files with more than 31 characters.
    G5 2x2.5 GHz 2.5 GB RAM / PowerBook 1,67 GHz 1,5 GB RAM   Mac OS X (10.4.5)  

  • Can long file names survive OSX to OS9 to OSX?

    This computer has dual boot capability, but since owning it I haven't actually booted to OS9 and have used it extensively with Tiger. I know OSX supports much longer file names than OS9. I recall back when I used both OS9 and OSX computers if I took a file created under OSX and looked at the directory under OS9 that all the long file names were truncated and/or encoded at the end (I never did it the other way around and always stuck with short names on all the files I used on both systems). Now I'm wondering if I boot to OS9 and then boot back to OSX if something permanent will happen to my long file names. Will they survive a passive journey but not if I actually open them with something, such as all my music files if I have them in SoundJam? A simple answer probably, but maybe I can get an answer here rather than the "backup, try it, and see" method.

    Will they survive a passive journey
    Yes.
    if I actually open them with something, such as all my music files if I have them in SoundJam?
    It depends on whether the application supports long file names; if not, the file's actual name will become set to the encoded name upon copying or modification of the file, and the application may not be able to access it. Using a Disk Copy version that doesn't support long file names to convert a disk image containing them without resizing the image will preserve them.
    (46719)

  • Cant download pdf files with long file names??

    Why in windows mobile wont it let me open/download pdf links th have long file names...works fine on desktop....just a mobile issue??? Have Lumia 930...windows mob 8.1

    Personally, I've not heard of this but maybe WP doesn't handle long names as well as Windows - what actually happens when you try? Is there an error message or does the download just fail silently?

  • Reader not showing pdf with long file names in IE8 for standard user

    Hi,
    I have this problem for standard users, that is, not Admin level.  Admin level users have no problems.
    If a web site opens up a pdf file with java, usually in a new window, and the file name is very long (I haven't figured out how long, but visually long) then the reader plug-in won't work and opens a blank page.  If the file name is small then there is no problem, and reader opens the pdf without problem.
    Interestingly, if I edit the document name (say for example the link has something on the end like "&Doc_Type=Statement" which is obviously not part of the document name but part of the SQL used to find the document by the web page) then reader will open the file no problem.
    Again, this doesn't happen for Administrative level users.
    Any ideas on how to fix?

    I'll crosspost to the reader forum.
    Yes, reader works in all other situations.

Maybe you are looking for

  • Macmini can't wake up and I Get a Black Screen

    Hi all, this is my first post in this community. Please do help me. I purchased a Mac mini (2012 late model, OS was originally Mavericks 10.9.1 when the machine arrives at my home. ) in January 2014. I used a “miniDP to DP adapter” to connect the Mac

  • Excel sheet values are displayed in Chinese while reading from server in WD

    Hi, I am reading an excel file values, from the excel sheet which is in the server. I am able to the read the values from webdynpro, but the values which i'm getting are in Chinese language. But the excel sheet there in server has the values in Engli

  • Exception pad block corrupted using AESLight from BouncyCastle

    Hi all! I�m trying to encrypt and decrypt using AESLight from Bouncy Castle to provide cryptographi to my mobile application. I encrypt the text with no problems, and sometimes i decrypted with no problems to! But, with some messages i got the follow

  • Export to tape grayed out

    I am a new user of Premiere Pro CS6 (migrating from Final Cut.) I am trying to Export to Tape with a simple DV clip. When I try to select Export/Tape, the "tape" option is grayed out. In the Sequence Settings, the "playback options" are likewise gray

  • General poor performance

    Hello all, This is a rather broad question, but one I need help with so here goes... I'm running FCE4 w/ my MacBook Pro. I'm still in the learning process so I was trying some things like mattes, etc. When I applied a matte to a 10 second clip, I got