• 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: Creating a new folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a new folder


  • Subject: Re: Creating a new folder
  • From: Michelle Steiner <email@hidden>
  • Date: Sun, 9 May 2004 21:23:00 -0700

On May 9, 2004, at 9:03 PM, Carl Anderson wrote:

set PartA to path to desktop
set PartA to PartA & "Test:"
display dialog PartA as text
tell application "Finder"
set myNewFolder to make new folder at PartA with properties
{name:"Temp"}
end tell

The problem is that PartA is an alias, not a string. So, PartA & "Test" results in a list, {alias "Dora:Users:michelle:Desktop:", "Test:"}.

When you display dialog, Applescript coerces that list into a string, in order to display the text you asked it to disply.

So, when you try to make the new folder, the script first makes a new folder at the first element of the list, which is the desktop; then it tries to make another folder at "Test" but because that is a string, you get an error.

To fix the problem, change the first line to

set PartA to (path to desktop) as text

-- Michelle

--
You can not change the world without perforce changing yourself.
_______________________________________________
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.


References: 
 >Re: Creating a new folder (From: Carl Anderson <email@hidden>)

  • Prev by Date: Re: Creating a new folder
  • Next by Date: Re: [ADMIN] Reminder: turn off the list before turning on your vacation responder
  • Previous by thread: Re: Creating a new folder
  • Next by thread: Re: Creating a new folder
  • Index(es):
    • Date
    • Thread