Drag and Drop Applescript inside of xcode.

So, I made a droplet script, but How would I bring it into a window.

Here’s my droplet applescript:


open target_files
	tell application "Finder"
		display dialog "Warning, this will permanently delete file(s)."
		repeat with aItem in target_files
			set file_path to quoted form of POSIX path of aItem
			set command to "rm -P " & file_path
			ignoring application responses
				do shell script command
			end ignoring
		end repeat
	end tell
end open


How would I get my app to respond in xcode to this code?

Click on the links below to see photo’s of what I’m trying to accomplish.

http://cl.ly/f810a875a015dfae703f
http://cl.ly/d4e2524a13b47e53f92b

Once I click on the tick box to enable dragging and dropping, and select my applescript file, I’m clueluess what to do from there.

It auto generates this code:

on drop theObject drag info dragInfo
	(*Add your script here.*)
end drop

on drag entered theObject drag info dragInfo
	(*Add your script here.*)
end drag entered

on conclude drop theObject drag info dragInfo
	(*Add your script here.*)
end conclude drop

on drag theObject drag info dragInfo
	(*Add your script here.*)
end drag

on drag exited theObject drag info dragInfo
	(*Add your script here.*)
end drag exited

on drag updated theObject drag info dragInfo
	(*Add your script here.*)
end drag updated

on prepare drop theObject drag info dragInfo
	(*Add your script here.*)
end prepare drop

So how can I get my script to work inside of the apps window?

THANKS :smiley:

Model: iMac8,1 (Late 2008)
AppleScript: 2.1.2
Browser: Safari 531.22.7
Operating System: Mac OS X (10.6)

You’re in the wrong forum – try next door for AppleScript Studio.

No, this is an apple script application in xcode with Objc

That may be, but it’s not AppleScriptObjC – things like the open handler and on drop handlers are part of AppleScript Studio, not AppleScriptObjC.