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 5955091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:03:52+00:00 2026-05-22T18:03:52+00:00

I am building a Applescript droplet to automate some stuff. I have the following

  • 0

I am building a Applescript droplet to automate some stuff. I have the following line:

tell application "Finder" to duplicate dropped

Dropped being a reference to the file that was dropped on the droplet. The documentation says that this returns a reference to the duplicated object.

I want to set myVariable to the reference that is returned but I can’t find in any of the documentation how to actually do that!

  • 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-22T18:03:53+00:00Added an answer on May 22, 2026 at 6:03 pm

    if it’s a droplet, be aware that the parameter is a list of aliases (you can drag more than one file!), and that if you duplicate a single finder item you will get a finder item, whereas if you duplicate more than one finder item, you will get a list of finder items. i.e. the return value of duplicate depends on the parameters sent to it.

    AND… finder items are not very useful outside the finder. You’d be better off with aliases or POSIX paths.

    So you probably need something like

    on open (dropped)
    
    tell application "Finder"
        set duplicate_Finder_items to duplicate dropped
    end tell
    
    -- convert the Finder reference for each duplicate item to an AppleScript alias
    
    set duplicate_item_aliases to {}
    
    if class of duplicate_Finder_items is list then
        repeat with i from 1 to number of items of duplicate_Finder_items
            set the end of duplicate_item_aliases to (item i of duplicate_Finder_items) as alias
        end repeat
    else -- result was a single Finder item, not a list
        set duplicate_item_aliases to {duplicate_Finder_items as alias}
    end if
    
    repeat with f in duplicate_item_aliases
        set inf to (info for (f as alias))
        set n to name of inf
        display dialog "You duplicated a file. The duplicate is now known as " & n
    end repeat
    

    end open

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

Sidebar

Related Questions

Building a rails B2B application that will have various users. I'm pretty clear on
Building an MVC 3 app with Razor and I have some information persisted in
Building an application to calculate metrics on Service Level Agreements. I have access to
Building a solution from Visual Studio in mono develop seems to have some issues.
Building a lottery scratch-card app in Java. Have allot of it done, just need
Building a client-side swing application what should be notified on a bus (application-wide message
Building the same project (without any changes) produces binary different exe-files: some small regions
Building a commercial product may use various open source libraries that have use of
Building a website using a PHP based Ecommerce product Magento. The problem I have
So far I have been building my Rail app on a Mac OS X

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.