0

As far as I can tell the standard applescript code for changing filenames is:

set name of my_file to "New_Name"

But when I use this inside a repeat loop (called by a folder action) I get a "Stack overflow" error. Here's the full code:

on adding folder items to this_folder after receiving these_items
    try
        repeat with this_item in these_items
            set name of this_item to "New_Name"
        end repeat

    on error error_message number error_number
        display dialog error_message buttons {"Cancel"} default button 1
    end try
end adding folder items to

Has anyone come across this problem? Might it have anything to do with Mountain Lion?

1 Answer 1

1

Try:

tell application "System Events" to set name of this_item to "New_Name"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.