Applescript to automatically add .noindex extension to a file? I'm interested in excluding certain files from Spotlight, and it was suggested to add the .noindex extension. I'd like to automate this. How is it possible to do via Applescript?
The following AppleScript will append the extension .noindex to any single file. To use this particular script, paste it into a new AppleScript document and save it as an Application. It will have a Application like icon with an arrow. This means the script is a droplet. To rename any single file, simply drop the file on top of this application's icon, and the file will have been renamed in under a second.

on open theFileToRename
    tell theFileToRename
        tell application "Finder"
            set theName to the name of file theFileToRename as string
            set extension to ".noindex"
            set the name of file theFileToRename to (theName &amp; extension)
        end tell
    end tell
end open


If you don't want to use the functionality of Droplets, the following script will prompt you to select a file:

set extension to ".noindex"
set theFileToRename to (choose file with prompt "Select a file to append the \"" &amp; extension &amp; "\" extension to." without multiple selections allowed)
tell application "Finder"
    set theName to the name of file theFileToRename as string
    set extension to ".noindex"
    set the name of file theFileToRename to (theName &amp; extension)
end tell


I hope this is useful to you.