• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drag and Drop / AppleScript Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag and Drop / AppleScript Problem


  • Subject: Drag and Drop / AppleScript Problem
  • From: Zico Kolter <email@hidden>
  • Date: Mon, 6 Jan 2003 17:42:07 -0500

Hey everyone,
I have an NSTableView which serves as a file list. One of the columns in the table is a "Kind" field, which mimics the Kind information that the finder displays about a document. To grab this, I use a simple NSAppleScript object, with a script something along the lines of "tell application "Finder" to return the kind of file <filepath>". This has worked great.

Now I'm trying to add drag and drop capabilities to the table view. I want to be able to drag a file from the finder into the list. I've overidden the "tableView:validateDrop:proposedRow:proposedDropOperation:" and "tableView:acceptDrop:row:dropOperation:" datasource methods, from from inside the acceptDrop: method I try to get the file Kind using my applescript call.

Although this does eventually work, it freezes the finder and my application for about 15 seconds. The problem seems to be that the finder is waiting on the acceptDrop: method which it turn waits on the finder to be free, so it can ask it to run the script. What do you all think is the best way out of this? Is there an easier way to get an equivalent of the Finder's Kind string? Should I somehow queue the list of filenames and actually add them to the list outside of my acceptDrop: method? (this is what I've been thinking but I'm unsure of the best way to do this).

Anyway, any help is much appreciated.

Zico Kolter
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Current Selector
  • Next by Date: Re: porting apps from NextStep to Cocoa
  • Previous by thread: Re: Current Selector
  • Next by thread: SOLVED - Was: Localization w/ parameters
  • Index(es):
    • Date
    • Thread