Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New window (was (no subject))



On Sep 29, 2006, at 8:50 AM, Steven DeWitt wrote:

A basic question: I know how to get AppleScript to make a new folder, but how do I tell it to make the new folder in the currently active folder, i.e., in the folder I am currently in in Finder?

tell application "Finder" to make new folder at the front window

Thanks very much Michelle. And sorry to group for lack of subject line, I am a newsgroup veteran but was too quick on the draw this time around.

No problem; you're not the first to do it, and you certainly won't be the last.


Oh by the way, if you want to create a new window at a user- designated location, here's some code that will do that for you:

tell application "Finder" to make new folder at (choose folder with prompt "Where should the new folder be created?") with properties {name:(text returned of (display dialog "What is the new folder's name?" default answer "Untitled Folder"))}

The following script will let the user do with one dialog:

set foo to ((choose file name with prompt "Choose the new folder's path and name.") as text)
set text item delimiters to ":"
set FilePath to (text items 1 through -2 of foo) as text
set FileName to last text item of foo
set text item delimiters to ""
tell application "Finder" to make new folder at folder FilePath with properties {name:FileName}


--
"As democracy is perfected, the office of president represents, more and more closely, the inner soul of the people. On some great and glorious day the plain folks of the land will reach their heart's desire at last and the White House will be adorned by a downright moron."


.... H.L. Mencken ...

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >(no subject) (From: Steven DeWitt <email@hidden>)
 >Re: (no subject) (From: Michelle Steiner <email@hidden>)
 >Re: (no subject) (From: Steven DeWitt <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.