AppleScript: Rename the files at random

Hi, I want to rename files at random using an AppleScript script, which I do not know yet. I wish I had a random number with a '. ' or '-', and then with the rest of the file name initial. Example: "music.dat" would become something like '4537.music.dat' or ' 4537 - music.dat. I received a small script that does something similar, but not with the name of the file, if it looks like "4537.dat" I want (for another debate).

Could you help me to modify the following script to get the desired result? Thank you.

Tell application "Finder".

Repeat with this_item (get 1 window points)

set this_item to ((nombre aléatoire compris entre 1000 et 9999) name & "." & name this_item extension) as string

end repeat

tell the end

Replace the third line with:

set this_item to ((nombre aléatoire compris entre 1000 et 9999) name & "." & name of this_item) as string

(139885)

Tags: Mac OS & System Software

Similar Questions

  • Rename the files/folders WARNING

    I want to put in place a prompt when a user tries to rename files or folders. Instead of rename automatically, I want to have a prompt that displays something like: are you sure you want to rename this file/folder? I've seen other systems use these guests and I wonder if its possible to put up on my computer as well.

    Hi HK2424,

    Usually, we get the prompt when we try to change the extension of a file and not to rename the file. You should have seen the prompt for changing the file extension and no change in file name.

    There is no option to activate the command prompt to rename files.

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Rename the file after the shooting

    Is it possible to rename the files after the shooting? I need to associate each product pictures a thousand to its code to bars and I have no idea how fast.

    If you already know every name, you need to be, you can do it in a batch file.  I used a spreadsheet to build orders quickly before, then paste them into Notepad, save as a batch, and then run it.

    You will need to know, ahead, of what each image original name and the name of bar code is.

    You can simply highlight the list of orders for change of name and paste it into a prompt for this flow and execute all the orders for you.

  • Photoshop CC (2015.5); Installation failure, unable to move the file. Rename the file and try again

    Right. So I downloaded and I logged into Adobe Creative cloud and I tried to download Photoshop CC (several times). But when it gets to 90%, I get the error in the title ("the Installation failed, cannot move the file. Rename the file, and then try again")

    I tried using error messages in the logs for troubleshooting, but I found nothing. Here are the 2 error messages I receive.

    'Key3List build failure'.

    and

    ""ACCC: could not find the LEIDs/LEID tags in the request data".

    I use Windows 10 x 64-bit PC

    If someone knows the problem, I found a solution and probable cause.

    I have Kaspersky Protection. Disable it while you download. This probably applies to more than a bag of protection.

    Thank you

  • Recently, when I download files from the SD card, LR6 not rename the files. How can I fix it?

    Recently, when I download files from the SD card, LR6 not rename the files. How can I fix it?

    If I open the folder, not through Lr, I can rename the file. Now, the problem disappeared. Maybe it was related to the DD. I removed and put back in place the protections in SD via the menu of my camera and the problem disappeared. Now, he works as usual. Amount and rename the files by LR. Thank you for your interest

  • The lateset, 2015.5 edition, does not transfer data from the metadata, only the focal length objective. Disappointment when you want to know what that lens you used. (It allows to rename the files but after you create a second copy. "It's an improvement.)

    The last edition, 2015.5, does not transfer data from the metadata, only the focal length objective. Disappointment when you want to know what that lens you used. (It allows to rename the files but after you create a second copy. "It's an improvement.)

    Yes, copied files from Nikon NEF, DNG.

  • When I tried the update of lightroom cc2015 I get a U44M2P7 error message. I tried to rename the file update and a new attempt and also update manually but still the same error. I use a mac with os x El Capitan version 10.11.3 any suggestions would be gra

    When I tried the lightroom cc2015 update I get an update of the failure U44M2P7 error message. I tried to rename the file update and a new attempt and also update manually but still the same error. I use a mac with os x El Capitan version 10.11.3 any suggestions would be greatly appreciated.

    U44... Update error http://forums.adobe.com/thread/1289956 can help

  • signed a document but dc do not rename the file "document-signed.

    When I sign a document in dc is no longer renames the file "document - signed" as it did in x 1, I missed something?

    Hi paule10771727,

    CD player will not add suffix signature to the document, you must rename the file.

    This feature has been deprecated.

    Kind regards
    Nicos

  • Rename the files in the prelude?

    I don't see a way to rename the video files in prelude.  Coming from a background of picture yet I always renamed files a sensitive name at the point of import.  If this cannot be done prelude is a suggestion on how to do this before prelude?  Kind of prelude to the use of prelude?  For now, I continue to import and rename both still and files vid in Lightroom but I would like to see this as a prelude.

    Thank you.

    Hello

    Thanks for your post. We have added the ability to rename ingest in our backlog of products for

    Review.

    Question for you: when support with a structure complex (XDCAM, P2, etc.) that you expect actually rename the files on the drive or the ability to apply an alias name that is stored in the metadata, such as the alias is displayed in all Adobe applications via the workflow?

    Thank you

    Michael

    Sent from my iPhone

  • Rename the file to the BONE

    Hi all

    I need to rename a file, I use (UTL_FILE. FRENAME) to rename all the files in this code:
    the syntax is : 
    
    src=>source
    dist=>distenation
    
      UTL_FILE.FRENAME('src_fold', 'src_file.ext',
         'dist_fold', 'dist_file.ext', TRUE);
    You must first create a directory in the operating system
    and put in this folder the files that you want to change the name it

    I create this folder in drive C (c:\colla)
    conn / as sysdba;
    
    grant CREATE ANY DIRECTORY TO scott;
    
    CONN SCOTT/TIGER;
    
    create or replace directory COLLA as 'c:\colla';
    
    now create a txt file in this folder with any name say ccc
    
    example :
    
    BEGIN
      UTL_FILE.FRENAME('COLLA', 'ccc.txt',
         'COLLA', 'CCCC.txt', TRUE);
    END;
    so far everything is fine, but if you try to add variables to the code you will see many errors and my file will be

    DELETE or disappear

    Like this:
    create or replace procedure rename_file(dname varchar2)
      is
      v_file varchar2(30) :='CCCC.txt';
      v_lower varchar2(30);
      begin
      v_lower:=lower(v_file);
      UTL_FILE.FRENAME(dname, v_file,
           dname, v_lower, TRUE);
      end;
    /
    
    Procedure created.
    
    SQL> exec rename_file('COLLA');
    BEGIN rename_file('COLLA'); END;
    
    *
    ERROR at line 1:
    ORA-29292: file rename operation failed
    ORA-06512: at "SYS.UTL_FILE", line 340
    ORA-06512: at "SYS.UTL_FILE", line 1186
    ORA-06512: at "SCOTT.RENAME_FILE", line 7
    ORA-06512: at line 1
    Please help & advice

    Published by: user10947262 on January 8, 2010 22:10

    Published by: user10947262 on January 8, 2010 22:25

    Published by: user10947262 on January 8, 2010 22:32

    Published by: user10947262 on January 8, 2010 22:40

    Hello

    The most obvious tool to rename a file in PL/SQL, we the UTL_FILE procedure called FRENAME. Oracle docs have information on the use of FRENAME:

    "The UTL_FILE. FRENAME procedure renames a file under a new name. You will rename the file userdata.txt to userdata2.txt directory USER_DIR run the SQL in SQL * more:

    try something like this
    {code}
    @frename

    connect hr/hr@orcl
    SERVEROUTPUT on

    BEGIN

    UTL_FILE. FRENAME ('Options', 'userdata.txt', 'Options', 'userdata2.txt', TRUE);

    END; /
    {code}

    Sarah

  • Searching for files and rename the file

    In my C:\, I have a number of files, namely C:\myfolder1, C:\myfolder2, C:\myfolder3... and in each folder, I have several text file *.txt.

    I want to have a code that go all C:\myfolder* and rename the text in file bin, for example. ABC.txt to the abc.bin.

    I know I can do this easily by using the command line. But how can I do this in LV?

    Essential is to know how to go through all the myfolder? *

    To my knowledge there is no direct function to rename, but you can do this by moving the file and stick with the target file. See the attached example.

  • Is it possible to rename the files in a particular format?

    Hello! I work with dozens of files like this all day, and I tried to understand if there is a way to rename them which will reduce my processing time. I know the company F2, but who don't get what I need. Here's an example, please let me know if you have any ideas. I do this particular task on Server 2003 Enterprise v5.2. But, if it makes a difference, I could move the files and do it on Server 2008 R2 Standard, 7 or XP.

    I have these three files:

    123_b_456.txt

    456_g_789.txt

    456_e_789.txt

    And I want to finish with looks like this:

    123_b.txt

    456_g.txt

    456_e.txt

    Is there a way to do this?

    Thanks a bunch!

    Hello

    Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the Windows server on TechNet. Please ask your question in the TechNet Windows Server Forums. You can follow the link below to ask your question: http://social.technet.microsoft.com/Forums/en-US/category/windowsserver

  • Rename the files & folders with a single command?

    I would like to rename a file folder and all the files & documents it contains.  The name is xxNAMExx I want to replace the part of middle NAME.  How can I do?

    Download the 32-bit version or 64-bit Bulk Rename, here http://www.bulkrenameutility.co.uk/Main_Intro.php

  • -Update - files have been published in a folder, all the files at random, most of the types I ever heard!

    -Updated - 05/11/15

    After Running System Mechanic - Iolo (that I highly recommend to anyone that's awesome) 59 registry problems were found and fixed as well as many other issues. No virus found so maybe my computers just more old and senile!

    Now I always have these random files from programs ect... Should I just reinstall and delete them all?

    Some examples of files are listed below in the original post.

    -Original message-

    Can someone help me please, I tried to find a solution but all I can find is the opposite of what happens here!

    (I made the "BOLD" main points, so you can skim read)

    Library of Documents, I go into My Documents, >Carlies animals >Carlies Music.

    As you can tell here are the files I created, I have not put this file in a download directory , or something like that.

    etc I tried to hide hidden files and the file does not include 'other places'.

    I had random pictures appear, about 4000 files.

    I did a virus scan, a threat was found and removed however has not changed.

    Some files I've actually put in new folders just to organize them, but then I thought that I should leave the rest alone incase

    It affects the location of them caused them non-functional or be corrupted.

    Some of these files come from two games, these two games are basic games that are primarily of jpegs, documents, Notepad and .vlc for sounds

    and they have just appeared in this folder. I also got these small gifs appear and I do not know they came however they do not stop in .gif they end up in underscore.

    Other files are PDF, Excel Docs together mix stuff randomly along with zipped files, Installation configurations:

    -.dll

    -.ocx

    -table

    -.inf

    -.sam

    -.prt

    -.sdb

    -.rul

    -.mmc

    -.pen

    -.olb

    -.mof

    -_s

    -.elm (Microsoft Office themes)

    -.mdf

    -.map

    -Google Chrome HTML files.

    It is in fact much more than I expected so I'll leave the rest.

    These file types are those that I have never heard about.

    If I do not know where the files were created by, should I move them back?

    Please help me!

    Thank you for taking the time to read this.

    Hi Carlie,

    My apologies for the delay in response.

    The following information will help us refine this question.

    1. What is the name of the folder?
    2. What is the location of the folder? To find it, follow this process, right click on a folder, click Properties, click the location tab)
    3. Also check the information creation, modification, access files. (To find it, follow this process, right click on a folder, click Properties, on the general tab you can find the information above).

    If the folder is created recently, you can perform a system restore to the day before the date of this file has been created.

    http://Windows.Microsoft.com/en-us/Windows/what-is-system-restore#1TC=Windows-7

    System Restore warning: When you use system restore to restore the computer to a previous state, the programs and updates that you have installed are removed.

    Thank you.

  • Error 0x8007000D try to move and rename the file

    Hi, I'm Ayu. I have problem when you try to move the folder and rename the folder, error 0x8007000D: these data are incorrect, still stood. Someone help me please.

    Thank you

    Hello

    The most likely cause is a 3rd party antivirus/security program or some sort of system optimizer
    (these are all snake oil). If using a 3rd party antivirus uninstall completely and use MSE - free.

    List of tools to clean/uninstall anti-malware programs
    http://answers.Microsoft.com/en-us/protect/wiki/MSE-protect_start/list-of-anti-malware-product-removal-tools/2bcb53f7-7ab4-4EF9-ab3a-6aebfa322f75

    Uninstallers (removal tools) for common antivirus software
    http://KB.eset.com/esetkb/index?page=content&ID=SOLN146

    MSE - free
    http://Windows.Microsoft.com/en-us/Windows/Security-Essentials-download

    ================================================

    All the methods in this article may apply

    Error: Windows Explorer has stopped working
    http://support.Microsoft.com/kb/2694911

    Follow these steps:

    Try these to erase corruption and missing/damaged file system repair or replacement.

    Start - type this in the search box-> find COMMAND at the top and RIGHT CLICK – RUN AS ADMIN

    Enter this at the command prompt - sfc/scannow

    How to fix the system files of Windows 7 with the System File Checker
    http://www.SevenForums.com/tutorials/1538-SFC-SCANNOW-Command-System-File-Checker.html

    How to analyze the log file entries that the Microsoft Windows Resource Checker
    (SFC.exe) program generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    Also run CheckDisk, so we cannot exclude as much as possible of the corruption.

    How to run check disk in Windows 7
    http://www.SevenForums.com/tutorials/433-disk-check.html

    ==========================================

    After the foregoing:

    How to troubleshoot a problem by performing a clean boot in Windows
    Vista or Windows 7

    http://support.Microsoft.com/kb/929135

    Use advanced tools to solve performance problems in Windows 7
    http://www.howtogeek.com/HOWTO/6152/use-advanced-tools-to-troubleshoot-performance-problems-in-Windows-7/

    ==================

    If nothing else work (and you should try all the above first) then make a new account. Switch
    and see if it works there. If so, you will need to migrate to the new.

    Difficulty of a corrupted user profile
    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

Maybe you are looking for

  • Tecra S3: issues of recovery dvd

    Salvation; I have a Tecra S3 120 model and its drive hard sata 80 GB has been partitioned to install debian and other BONE and have a backup only fat32 partition. Tecra have a manual and a single DVD, the recovery DVDs. A long time, I decided to have

  • Qosmio X 70 - the SD card reader does not work

    I upgraded to 8.1 win a moment the card reader does not work. Nothing happened when I put a card inside. I tried serveral. I changed the driver to a new from the homepage of Realthek - nothing. What can I do?

  • The icons on my desktop page always put to the left of the screen

    My OS is XP Home edition and as the title suggests the icon all go to the left, little matter what settings I use.Auto arrangesnap to gridlock web items on desktopand it is not a difference how to sort the icon is This happens whenever I have "discon

  • Negative terminals on the terminal block

    Hello, this is a really stupid question, but after using my card for the acquisition of data (NI DAQcard 6024E) with my connection block (SCC-68) more than one year with entries NRSE, I now need to connect differential inputs. However, the connection

  • How to make the Windows 7 network icon to show availability of internet connection?

    Hello!Windows 7 network icon shows no availability of internet connection. Windows Vista network icon showed availability of internet connection with a globe. How to make the Windows 7 network icon to show availability of internet connection?Concerni