MACSCRPT Archives

March 2010

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Barry Wainwright <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 5 Mar 2010 16:57:05 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
>Is there a way to make an Applescript app so that if you drop a file  
>on it it does its thing, but if you just double-click it displays a  
>dialog and asks you for the info you would have dropped? IOW, "on  
>open" and "on run" in the same app.
>
>Bill Steele
>[log in to unmask]
>

on open (theFiles)
 my doStuff(theFiles)
end open

on run
 set theFiles to (choose file with prompt "Select the files to work on..."
with multiple selections allowed)
 my doStuff(theFiles)
end run

on doStuff(fileList)
 repeat with aFile in fileList
  -- do stuff to each file
 end repeat
end doStuff



-- Barry

ATOM RSS1 RSS2