Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6198045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:55:45+00:00 2026-05-24T03:55:45+00:00

I just edited the file new item alert.scpt in the /Macintosh HD/Library/Scripts/Folder Actions…/ folder.

  • 0

I just edited the file new item alert.scpt in the /Macintosh HD/Library/Scripts/Folder Actions…/ folder. I managed to save it after editing some permissions, but when I click Run or Compile nothing happens.

Is this a common error, or do I have a problem in my applescript if someone wouldn’t mind taking a look.

property Docs : "Macintosh HD:Users:Max:Downloads:Docs"
property Music : "Macintosh HD:Users:Max:Downloads:Music"
property Videos : "Macintosh HD:Users:Max:Downloads:Videos"
property Images : "Macintosh HD:Users:Max:Downloads:Images"
property Profiles : "Macintosh HD:Users:Max:Downloads:iPhone:Profiles"
property Zips : "Macintosh HD:Users:Max:Downloads:Zips"
property PSDs : "Macintosh HD:Users:Max:Downloads:PSDs"

on adding folder items to this_folder after receiving added_items
    try
        tell application "Finder"
            --get the name of the folder
            set the folder_name to the name of this_folder
            if (name of eachitem ends with ".png") then
                move eachitem to folder Images
            end if
            if (name of eachitem ends with ".JPEG") then
                move eachitem to folder Images
            end if
            if (name of eachitem ends with ".gif") then
                move eachitem to folder Images
            end if
            if (name of eachitem ends with ".jpg") then
                move eachitem to folder Images
            end if
            if (name of eachitem ends with ".jpeg") then
                move eachitem to folder Images
            end if
            if (name of eachitem ends with ".PNG") then
                move eachitem to folder Images
            end if
            if (name of eachitem ends with ".mov") then
                move eachitem to folder Videos
            end if
            if (name of eachitem ends with ".avi") then
                move eachitem to folder Videos
            end if
            if (name of eachitem ends with ".wma") then
                move eachitem to folder Videos
            end if
            if (name of eachitem ends with ".m4v") then
                move eachitem to folder Videos
            end if
            if (name of eachitem ends with ".mp4") then
                move eachitem to folder Music
            end if
            if (name of eachitem ends with ".mp3") then
                move eachitem to folder Music
            end if
            if (name of eachitem ends with ".wav") then
                move eachitem to folder Music
            end if
            if (name of eachitem ends with ".wma") then
                move eachitem to folder Music
            end if
            if (name of eachitem ends with ".pdf") then
                move eachitem to folder Docs
            end if
            if (name of eachitem ends with ".doc") then
                move eachitem to folder Docs
            end if
            if (name of eachitem ends with ".docx") then
                move eachitem to folder Docs
            end if
            if (name of eachitem ends with ".pages") then
                move eachitem to folder Docs
            end if
            if (name of eachitem ends with ".ppt") then
                move eachitem to folder Docs
            end if
            if (name of eachitem ends with ".pptx") then
                move eachitem to folder Docs
            end if
            if (name of eachitem ends with ".mobileprovision") then
                move eachitem to folder Profiles
            end if
            if (name of eachitem ends with ".zip") then
                move eachitem to folder Zips
            end if
            if (name of eachitem ends with ".psd") then
                move eachitem to folder PSDs
            end if


        end tell

        -- find out how many new items have been placed in the folder
        set the item_count to the number of items in the added_items
        --create the alert string
        set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
        if the item_count is greater than 1 then
            set alert_message to alert_message & (the item_count as text) & " new items have "
        else
            set alert_message to alert_message & "One new item has "
        end if
        set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
        set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")

        display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
        set the user_choice to the button returned of the result

        if user_choice is "Yes" then
            tell application "Finder"
                --go to the desktop 
                activate
                --open the folder
                open this_folder
                --select the items
                reveal the added_items
            end tell
        end if
    end try
end adding folder items to
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:55:46+00:00Added an answer on May 24, 2026 at 3:55 am

    Folder action scripts are not supposed to be run directly. It’s associated to any number of folders via the context menu of those folders.

    Then, whenever that folder’s content change, the script is triggered, and the on adding folder items to handler is run.

    So, you should just right-click the folder you want to attach the script, and choose Set folder action menu item.

    Also, you’re not supposed to overwrite the system-provided file… you can save your customized version in your own home directory and you can attach it to any folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just edited an .SWF file I have on my website home page for
I've always just FTPed files down from sites, edited them and put them back
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
i am very much new to Entity Framework and i just used this in
i got a problem with wix and managed custom actions: in my custom action
Just what the title says, I need to change the password for an existing
Just looking for the first step basic solution here that keeps the honest people
just a quick question: I am a CS undergrad and have only had experience
Just bought a 2.4GHz Intel Core 2 Duo iMac with 2GB of memory and
Just getting my head around Ruby metaprogramming. The mixin/modules always manage to confuse me.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.