• 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
Folder action when modifying a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Folder action when modifying a file


  • Subject: Folder action when modifying a file
  • From: Victor <email@hidden>
  • Date: Sun, 25 Apr 2010 12:11:02 +0200

while writing a document in Pages09  I'd like to save it from time to time via File->Save (or command-s) and have  it saved also as rich text format by an automatically triggered AS.

With the following AS script (working draft)

on adding folder items to this_folder after receiving added_items
	try
		tell application "Finder"
			set the folder_name to the name of this_folder
		end tell
		get info for item 1 of added_items
		set nomefile to name of result
		if nomefile ends with ".pages" then
			set nomefile to text 1 thru -6 of the nomefile
			set nomefile to nomefile & "rtf"
			tell application "Pages"
				save front document as ¬
					"SLDocumentTypeRichText" in "Macintosh HD:Users:victor:Desktop:Folder:" & nomefile
			end tell
		end if
	end try
end adding folder items to

Unfortunately it works only once that is when I save a document with a new file name for the first time in that folder .  If I goes on writing and saving the same file nothing happens, apparently because non new items have been added to the folder.
How can I make AS folder action sensitive also the variation of size of the file in the folder (or better, when I save during an editing session, also the folder changes its size).
Ciao
Vittorio _______________________________________________
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

  • Follow-Ups:
    • Re: Folder action when modifying a file
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Reveal the tables of a sheet in Numbers
  • Next by Date: Re: Folder action when modifying a file
  • Previous by thread: test
  • Next by thread: Re: Folder action when modifying a file
  • Index(es):
    • Date
    • Thread