• 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: The Save command will replace, without asking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Save command will replace, without asking


  • Subject: Re: The Save command will replace, without asking
  • From: Robert Poland <email@hidden>
  • Date: Fri, 7 Oct 2005 15:30:52 -0600

On Oct 7, 2005, at 10:06 AM, Robert Poland wrote:

After much searching I found this. "The Save command will replace, without asking, an existing file with the same name as the specified file (if one exists)."

Where did you find it? Does it apply to all applications, or just the one you're scripting?


Is that the bottom line or is there a way to not overwrite existing files?

I would prefer maybe adding an incrementing number to the name then saving.

Have the script check for an existing file of the same name. If one exists, save under a different name.


on validatefilename(myfilename, targetfolder)
	tell application "Finder"
		if myfilename is in name of files of targetfolder then
			--code to change name goes here
			my validatefilename(myfilename, targetfolder)
		end if
	end tell
	return myfilename
end validatefilename

-- code to save file goes here

Michelle,

Your solution looks so simple so I made it more complicated.

set targetfolder to "iMac HD:Users:rpoland:Desktop:"
set myfilename to "  test copy"
my validatefilename(myfilename, targetfolder)

on validatefilename(myfilename, targetfolder)
-- error here Can't get every file of "iMac HD:Users:rpoland:Desktop:"

Any clues?

Tia,
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: The Save command will replace, without asking
      • From: Dave Lyons <email@hidden>
    • Re: The Save command will replace, without asking
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: long shot..
  • Next by Date: Re: The Save command will replace, without asking
  • Previous by thread: Re: The Save command will replace, without asking
  • Next by thread: Re: The Save command will replace, without asking
  • Index(es):
    • Date
    • Thread