Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using AppleScript to drop a PDF file on a droplet.



I'm not sure exactly what you are asking, but I think maybe that you want both Drag & Drop and Select & Launch interfaces. The code isn't too complicated, so I'll just post it anyway and if it isn't on target, no problem.

on run
	my getFinderSelection() -- a list of aliases
	tell me to open the result
end run ---------------------------------------------

on open dropList
	-- your Drag & Drop code goes here
end open -------------------------------------------

on getFinderSelection()
	tell application "Finder"
		try
			set selList to selection
		on error
			return {}
		end try
		--
		set listCount to (count items of selList)
		if listCount = 0 then return {}
		repeat with i from 1 to listCount
			(item i of selList) as alias
			if (class of item the result) = alias file then
				set item i of selList to (original item of the result) as alias
			else
				set item i of selList to the result
			end if
		end repeat
		return selList
	end tell
end getFinderSelection ---------------------------------------


On Jun 25, 2006, at 7:20 PM, email@hidden wrote:

Hi all,

A few months back (if memory serves me correctly) someone was asking about
using AppleScript to drop a file onto a droplet. I'm now in need of such
code.


I have a PDF "Pre-Flight" droplet that I created from Acrobat 7 and I need
to have AppleScript drop a PDF (that the script just helped build) onto
this droplet. The results will be that the PDF is scanned and a log
report is produced. This is then read by AppleScript to look for errors.


I was hoping to launch the droplet then tell it to open a file but when
the droplet is launched without a PDF being dropped on it, it immediately
quits.


Any thoughts?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Using AppleScript to drop a PDF file on a droplet. (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.