|
|
#1 |
|
I want to make AppleScript Create Folder
I want to make applescript to create a folder in Mobile Document How do I do this i search everywhere but Can't find any
|
|
|
|
0
|
|
|
#2 |
|
Try google search terms:
applescript make new folder If the found results don't answer your question, then ask again, providing more details. I don't have a "Mobile Document" folder on my disk, and since you didn't tell us where yours is located, you'll have to be more specific. Tell us exactly where you want the new folder to be created, and what you want its name to be. |
|
|
|
0
|
|
|
#3 | |
|
Quote:
|
||
|
|
0
|
|
|
#4 | |
|
Quote:
Post the code you have now. If you don't have any code, tell us what tutorial or reference you're learning AppleScript from. Be specific: URL of tutorial, or title, author, and edition of book. If you're not learning AppleScript from a guided source like a tutorial or book, what are you learning from? If you don't know the fundamentals, you won't be able to write anything yourself. All you can do is paste together bits and pieces you find. |
||
|
|
0
|
|
|
#5 | |
|
Quote:
Code:
tell application "Finder"
set p to (path to) Macintosh HD:Users:Desktop-- Or whatever path you want
make new folder at p with properties {name:"New Folder"}
end tell
The problem is if I have the directory for the app program for my computer if a other user uses it it won't work. I want the AppleScript to work on any computer Last edited by Nermal; Feb 3, 2013 at 06:27 PM. Reason: added code tags |
||
|
|
0
|
|
|
#6 |
|
Is this for interacting with iCloud? If so, Apple has specific documentation on how to do that.
__________________
Questions? MRoogle it! I support the MacRumors Blood Drive! ![]() MR Scavenger Score: 1 |
|
|
|
0
|
|
|
#7 |
|
|
0
|
|
|
#8 |
|
For example let's say you want to make a new folder on the desktop.
You haven't changed the name of your startup disk and your username is david then the following code : Code:
path to desktop If you run this on another mac where you changed the name of the startup disk to MyBigDisk and you log on with the username black then the same code will give a result of : alias "MyBigDisk:Users:black:Desktop:" Info about the path to (folder) command and the special folder for which to return the path on this link : https://developer.apple.com/library/...983-CH216-SW19 You'll find it in the Commands Reference section. Or perhaps the path to resource might be of use to you as well.
__________________
Space Corps Directive 34124 |
|
|
|
0
|
|
|
#9 | |
|
Quote:
|
||
|
|
0
|
|
|
#10 |
|
Try this :
Code:
tell application "Finder"
set p to path to library folder from user domain
make new folder at p with properties {name:"New Folder"}
end tell
__________________
Space Corps Directive 34124 |
|
|
|
0
|
|
|
#11 |
|
|
0
|
|
|
#12 | |
|
Quote:
Code:
tell application "Finder"
set p to path to mobiledocuments folder from user domain
make new folder at p with properties {name:"New Foldergyg11tr"}
end tell
Last edited by maflynn; Feb 4, 2013 at 04:40 PM. Reason: Added code tags |
||
|
|
0
|
|
|
#13 |
|
What is this "Mobile Document" folder? I know I don't have it on my disk. The question has been asked already but you haven't provided an answer. Have you looked at the link I provided? Do you see any reference to the mobiledocuments folder in the special folder for which to return the path. Maybe I skipped over it but I just checked and it is not there so this :
Code:
set p to path to mobiledocuments folder from user domain
__________________
Space Corps Directive 34124 |
|
|
|
0
|
|
|
#14 | |
|
Quote:
Mobile Documents is a folder you have when you have iCloud. I want to make applescript make the folder in ~/Library/Mobile Documents |
||
|
|
0
|
|
|
#15 |
|
Unfortunately I don't have/use ICloud so I don't know if you're allowed to create folders in that Mobile Documents folder but you can try this :
Code:
tell application "Finder"
set p to (path to library folder from user domain as text) & "Mobile Documents:"
make new folder at p with properties {name:"TEST"}
end tell
__________________
Space Corps Directive 34124 |
|
|
|
0
|
|
|
#16 | |
|
Quote:
|
||
|
|
0
|
|
|
#17 |
|
Try this :
Code:
tell application "Finder"
set p to (path to library folder from user domain as text) & "Mobile Documents:"
try
set newFolder to make new folder at p with properties {name:"TESTING"}
make new alias at (path to home folder) to newFolder
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
end tell
__________________
Space Corps Directive 34124 |
|
|
|
0
|
|
|
#18 | |
|
Quote:
|
||
|
|
0
|
|
|
#19 |
|
Info : http://www.google.be/search?client=s...FOec0QXMhICgCQ
http://macscripter.net/viewtopic.php?id=36587 http://www.hamsoftengineering.com/co...tFileIcon.html Code:
set exePath to (path to home folder as text) & "SetFileIcon"
set imagePath to (path to desktop folder as text) & "Actions.icns"
tell application "Finder"
set p to (path to library folder from user domain as text) & "Mobile Documents:"
try
set newFolder to make new folder at p with properties {name:"TESTING"}
make new alias at (path to home folder) to newFolder
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
end tell
do shell script quoted form of POSIX path of exePath & " -image " & quoted form of POSIX path of imagePath & " -file " & quoted form of POSIX path of (newFolder as text)
__________________
Space Corps Directive 34124 Last edited by kryten2; Mar 14, 2013 at 04:06 PM. |
|
|
|
0
|
|
|
#20 | |
|
Quote:
|
||
|
|
0
|
|
|
#21 | |
|
Quote:
|
||
|
|
0
|
|
|
#22 |
|
Strange. It looks like there is no space between the & and "docs:doc" but it is not really clear. Try with another folder name or type the single set theFolder line in another script editor window and see if it compiles.
Code:
set exePath to (path to home folder as text) & "SetFileIcon" set imagePath to (path to desktop folder as text) & "Actions.icns" set theFolder to (path to desktop folder as text) & "docs:doc"
__________________
Space Corps Directive 34124 Last edited by kryten2; Mar 14, 2013 at 05:08 PM. |
|
|
|
0
|
|
|
#23 | |
|
Quote:
|
||
|
|
0
|
|
|
#24 |
|
You're getting an error because you didn't copy and paste the do shell script line exactly as it was posted.
It should be this: Code:
do shell script quoted form of POSIX path of exePath & " -image " & quoted form of POSIX path of imagePath & " -file " & quoted form of POSIX path of (newFolder as text) Code:
do shell script quoted form of POSIX path of exePath & "-image" & quoted form of POSIX path of imagePath & "-file" & quoted form of POSIX path of theFolder For example, in the original: Code:
& " -image " & Code:
& "-image" & And you made the same mistake where you have "-file". |
|
|
|
0
|
|
|
#25 | |
|
Quote:
Thanks you guys I got it too work!
|
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 01:19 AM.







I support the
esktop:"
Linear Mode
