AppleScript for creating a new folder

James.Cass at sealedair.com James.Cass at sealedair.com
Wed Jul 9 15:27:00 EDT 2003


Here's yet ANOTHER way.  I'm running Mac OS X 10.2.5.
-- ----------------------------------------------
tell application "Finder"
     set targetfolderpath to "Macintosh HD:Users:cassj:testfolder"  --
            "testfolder" already exists
     set newfoldername to "stoopidunderpants"
     if folder (targetfolderpath & ":" & newfoldername) exists then
           --do nothing
     else
           make new folder in folder targetfolderpath with properties
                   {name:newfoldername}
     end if
end tell
-- ----------------------------------------------

Hope this helps....Cassj




|---------+------------------------------------->
|         |           Trevor DeVore             |
|         |           <lists at mangomultimedia.com|
|         |           >                         |
|         |           Sent by:                  |
|         |           use-revolution-admin at lists|
|         |           .runrev.com               |
|         |                                     |
|         |                                     |
|         |           07/09/03 03:53 PM         |
|         |           Please respond to         |
|         |           use-revolution            |
|---------+------------------------------------->
  >----------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                            |
  |       To:       use-revolution at lists.runrev.com                                                                            |
  |       cc:                                                                                                                  |
  |       Subject:  Re: Applescript for creating a new folder                                                                  |
  >----------------------------------------------------------------------------------------------------------------------------|




On 7/9/03 Yves COPPE wrote

>Hi Trevor
>
>> You can check if a folder exists like this:
>>
>> tell application "Finder"
>>     if not ("Macintosh HD:users:tdevore:tést" exists) then
>>         make new folder at "Macintosh HD:users:tdevore" with
>> properties {name:"tést"}
>>     end if
>>     make new folder at "Macintosh HD:users:tdevore:tést" with
>> properties {name:"tésting"}
>> end tell
>>
>>
>
>It further create a folder on my desktop....

Hmmmm.  Désolé, mais I am no AppleScript expert (just barely learning) so I
don't know what the problem is.  It works here.  Scott seemed to have a
solution however.

Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
 http://lists.runrev.com/mailman/listinfo/use-revolution






More information about the use-livecode mailing list