• 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
Odd make folder behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd make folder behaviour


  • Subject: Odd make folder behaviour
  • From: Dave Balderstone <email@hidden>
  • Date: Thu, 26 Feb 2004 18:06:42 -0600

I was working on some code to check if folders exist on a server (and create them if they aren't there) today and saw some odd behaviour. Running Panther 10.3.2 on a 17" PowerBook, connecting to an Xserve running 10.3.2, afp connection (not TCP/IP). Using Script Debugger 3.0.7.

The code:

-----
set theYear to year of (current date) as text
set theMonth to do shell script "date '+%m'" as text
set theContainerFolder to "Archive:Photo_Archive:" as text
set theYearFolder to "Archive:Photo_Archive:" & theYear & ":" as text
set theMonthFolder to "Archive:Photo_Archive:" & theYear & ":" & theMonth & ":" as text
set theRawFolder to theMonthFolder & "raw:" as text
set thePublishFolder to theMonthFolder & "publish:" as text
tell application "Finder"
if not (exists theYearFolder) then
make new folder at theContainerFolder with properties {name:theYear}
end if

--snip sub folder creation code

end tell
-----

The oddity:

The line
make new folder at theContainerFolder with properties {name:theYear}

would only create untitled folders at "Archive:Photo_Archive:"

I recorded the Finder and got

tell application "Finder"
make new folder at folder "Photo_Archive" of disk "Archive" with properties {name:"2004"}
set name of folder "untitled folder 2" of folder "Photo_Archive" of disk "Archive" to "2004"
end tell

So I changed the code to:

set theYearFolder to make new folder at theContainerFolder with properties {name:theYear}
set name of theYearFolder to theYear

Which worked, so I deleted "with properties {name:theYear}" and the script errored

So I put it back. The script worked.

Then, curious about what was going on, I deleted "set name of theYearFolder to theYear" and...

The script worked.

??????

I'm sure there's an explanation. Can anyone enlighten me as to what it is?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Change Idle Period
  • Next by Date: Re: Results differ in editor and applet
  • Previous by thread: Re: Change Idle Period
  • Next by thread: AS/FMP: a list of fewer than two records
  • Index(es):
    • Date
    • Thread