• 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
Re: Opening the newest file in a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening the newest file in a folder


  • Subject: Re: Opening the newest file in a folder
  • From: has <email@hidden>
  • Date: Sat, 15 Dec 2007 00:05:03 +0000

On 14 Dec 2007, at 22:31, Craig Cope wrote:

I think you're right about folder actions. I have folder actions set to run my script, but the script won't open the file because I don't know how to tell it to get the file that was just dropped into the folder. I'm new with AppleScript and I don't think I'm yet, thinking like the guys who created it.


From the StandardAdditions osax, where the folder action event syntax is defined:

adding folder items to -- Called after new items have been added to a folder
alias -- Folder receiving the new items
after receiving list of alias -- a list of the items the folder received


As you can see, the 'adding folder items to' event supplies a list of alias values for the added items. Example:

	on adding folder items to theFolder after receiving theItems
		tell application "TextEdit" to open theItems
	end adding folder items to

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Opening the newest file in a folder (From: Craig Cope <email@hidden>)
 >Re: Opening the newest file in a folder (From: Doug McNutt <email@hidden>)
 >Re: Opening the newest file in a folder (From: has <email@hidden>)

  • Prev by Date: Re: Dumb Finder scripting question
  • Next by Date: Re: Excel 2004
  • Previous by thread: Re: Opening the newest file in a folder
  • Next by thread: Determine if a Word Document is New or Saved
  • Index(es):
    • Date
    • Thread