How do I rename a file using AppleScript?

Posted on 2007-08-03
Last Modified: 2013-11-05
Hi there,

How do I rename a file using AppleScripter?

Here's the pseudo code of what I want to do:

rename "path to file" to "path to new file"

But I can't seem to find the applescript equivelant.

Please let me know if you can be of assistance, I'd like to do it without any user interaction, the new name is automatically generated and the original name is known.

Question by:antum
    1 Comment
    LVL 24

    Accepted Solution

    tell application "Finder"
    set the name of the old_file_name to new_file_name

    something along this lines should work.


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
    Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now