• 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
check if folder exists in symbolic linked dir
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

check if folder exists in symbolic linked dir


  • Subject: check if folder exists in symbolic linked dir
  • From: "Patrick J. Collins" <email@hidden>
  • Date: Fri, 21 Apr 2006 12:21:46 -0700 (PDT)

Hi Everyone,

I am trying to create a folder named today's date in a symbolically linked
directory which points to a different hard drive--  Then move the items of my
desktop to it.

Everything works great except if the folder name already exists, I get an error
"Finder got an error: The operation could not be completed because there is
already an item with that name."

If I make iJunk a regular folder and not a symbolic linked directory then it
works fine-- So I am wondering, what is the problem and how can I make this
work with a symbolically linked dir.

Thank you!

Patrick J. Collins
http://collinatorstudios.com

My script so far:

property foldername : ""
set the_desktop to (path to desktop)

tell application "Finder"
	set datestring to my date_time((current date) as string)
	set foldername to "Desktop-" & datestring
	set AppleScript's text item delimiters to "/"
	set temp to text items of foldername
	set AppleScript's text item delimiters to "-"
	set foldername to temp's text items as string
	set AppleScript's text item delimiters to ""
	set x to path to home folder from user domain as string
	set x to x & "iJunk"
	set foldernameoriginal to foldername
	set r to 0
	repeat
		if not (exists folder foldername of folder x) then
			make new folder at x with properties {name:foldername}
			exit repeat
		end if
		set r to r + 1
		set foldername to foldernameoriginal & "-" & r
	end repeat

	set y to (x & ":" & foldername)
	set y to "mv ~/Desktop/* " & POSIX path of y
	do shell script (y)
end tell

on date_time(datestring)
	set my_date to date datestring
	return short date string of my_date
end date_time



 _______________________________________________
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: check if folder exists in symbolic linked dir
      • From: dev_sleidy <email@hidden>
  • Prev by Date: Re: set cpu speed
  • Next by Date: Re: check if folder exists in symbolic linked dir
  • Previous by thread: Re: [AS] Getting some Finder windows properties under 10.4.6...
  • Next by thread: Re: check if folder exists in symbolic linked dir
  • Index(es):
    • Date
    • Thread