【发布时间】:2015-06-09 04:50:01
【问题描述】:
set source to (choose folder default location ("~/Desktop/") with multiple selections allowed)
repeat with filetocopy in source
set n to (quoted form of (POSIX path of filetocopy)) & " "
set dir to do shell script "dirname " & n
set bn to do shell script "basename " & n
set n2 to "." & bn
set n3 to dir & "/" & n2
do shell script "mv " & n & space & quoted form of n3
end repeat
display dialog "Folders Hidden!" buttons {"OK"} default button 1
它拒绝将~/ 设为别名。但是,当我将其发布给朋友时,我无法使用我的用户名对路径进行硬编码。有什么简单的解决方案?
【问题讨论】:
-
@200_success 谢谢!会试试这个。
标签: macos applescript