Applescript按日期命名的新文件夹 [英] Applescript New Folder Named By Date
本文介绍了Applescript按日期命名的新文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
因此,我对applescript并不陌生,我正在尝试创建一个应用程序,该应用程序将在桌面上创建一个具有当前日期和时间名称的新文件夹.每次我运行它时,都会出现错误,并显示无法将"11/8/13"键入类型号."请帮忙,谢谢您的输入和回答!
So I am new to applescript and I am trying to make an application that will make a new folder at the desktop that has the name of the current date and time. Every time I run it, there is and error and it reads, "Can’t make "11/8/13" into type number." Please help and thanks for your input and answers!
tell application "Finder"
set p to path to desktop
set d to short date string of (current date)
set t to time string of (current date)
set FullDate to d + t
make new folder at p with properties {name:FullDate}
end tell
推荐答案
您使用&在AppleScript中串联,否则认为您正在尝试添加数字.
You use & to concatenate in AppleScript, otherwise it thinks you are trying to add a number.
set p to path to desktop
set d to short date string of (current date)
set t to time string of (current date)
set FullDate to d & space & t
tell application "Finder" to make new folder at p with properties {name:FullDate}
这篇关于Applescript按日期命名的新文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文