【问题标题】:Applescript Error -1700, cant make ~/Desktop/ into an aliasApplescript 错误 -1700,无法使 ~/Desktop/ 成为别名
【发布时间】: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

它拒绝将~/ 设为别名。但是,当我将其发布给朋友时,我无法使用我的用户名对路径进行硬编码。有什么简单的解决方案?

【问题讨论】:

标签: macos applescript


【解决方案1】:

你不需要 ~/.请改用(Path to desktop)

set source to (choose folder default location (path to desktop) with multiple selections allowed)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-18
    • 2013-09-12
    相关资源
    最近更新 更多