Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Demphis

macrumors newbie
Original poster
Oct 12, 2017
1
0
Hello, im trying to write a script that creates a folder and lets the user name it and choose location where to create it.
My script:
tell application "finder"
set theFolder to make new folder at dekstop
set theName to text returned of
(display dialog "Folderio pavadinimas" default answer "")
set loc to choose folder "Pasirinkite folderio lokacija"
end tell
Any solutions how to improve this program and make it work?
 
You can try this.

Code:
set theLoc to choose folder with prompt "Just testing"
set theName to text returned of (display dialog "Enter the name of the folder to create: " default answer "Test")
tell application "Finder"
   -- insert actions here
   if not (exists folder theName of theLoc) then
       set theFolder to make new folder at theLoc with properties {name:theName}
   end if
end tell

Note: Not at home and not tested. There's more than one way to get the result you need. Look at the Finder and Standard Additions Dictionaries.

Info : The First Step
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.