AppleScript的错误"不能让\\""入式整数QUOT。 -1700号 [英] AppleScript error "Can’t make \"" into type integer." number -1700

查看:231
本文介绍了AppleScript的错误"不能让\\""入式整数QUOT。 -1700号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个错误已经被这里所涉及,但我已经通过了答案,现在天一直在寻找,当我认为我已经破解它,我最终突破了code别处。

I know this error has been covered here but I have been searching through the answers for days now and when I think I have cracked it I end up breaking the code somewhere else.

我想在X code运行的AppleScript,使一个文件夹的备份一组网络的计算机上。

I am trying to run AppleScript in Xcode to make a backup of a folder on a set network machine.

我遇到的问题是,备份日期标记,并在用户的桌面上子文件。
我试图避免使用硬POSIX路径实现最终的应用普及。
我已经找到了所有解决方案都没有考虑这一点交代。

The problem I am having is that the backup is date stamped and in a sub folder on the users Desktop. I am trying to avoid using hard POSIX paths to make the final app universal. All the solutions I have found don't take this in to account.

我的凌乱code道歉,而且我仍然在学习的AppleScript等最终散列code不同的比特在一起。我的code是

I apologize for the messy code but I am still learning AppleScript and so end up hashing different bits of code together. my code is

set catFolder to "Catalyst AA"
set bckup to "Backups"
set myDesktop to path to desktop folder as alias
set main_folder to ((path to desktop folder) & "Backups") as string

tell application "Finder"
if not (exists folder (bckup) in myDesktop) then
    set main_folder to (make new folder at desktop with properties {name:bckup}) as      alias
else

    if not (exists folder (catFolder) in main_folder) then
        set cat_folder to (make new folder at folder main_folder with properties {name:catFolder}) as alias
    end if
end if

end tell



try
mount volume "afp://10.0.0.1/Content SSD AA/Catalyst/Catalyst 4.40_m373_HD"

set d to (year of (current date) as text) & "-" & (month of (current date) as integer as text) & "-" & (day of (current date) as text) & "-" & (time string of (current date))
tell application "Finder"
    set f to make new folder at POSIX file "~/Desktop/Backups/Catalyst AA" with properties {name:d}
    duplicate POSIX file "/Volumes/Content SSD AA/Catalyst" to f
end tell
try
    tell application "Finder"
        eject disk "Content SSD AA"
    end tell
end try
end try

错误文件

tell application "Finder"
path to desktop as alias
    --> alias "Macintosh HD:Users:ben:Desktop:"
path to desktop
    --> alias "Macintosh HD:Users:ben:Desktop:"
exists folder "Backups" of alias "Macintosh HD:Users:ben:Desktop:"
    --> true
Result:
error "Can’t make \"Catalyst AA\" into type integer." number -1700 from "Catalyst AA" to   integer

我AP preciate,如果有人能指出我要去哪里错了。

I appreciate it if someone can point out where I'm going wrong.

感谢您的时间

推荐答案

试试这个:

set folderPath to POSIX path of (path to desktop as text) & "Backups/Catalyst AA"
do shell script "mkdir -p " & quoted form of folderPath

try
    mount volume "afp://10.0.0.1/Content SSD AA/Catalyst/Catalyst 4.40_m373_HD"
    set d to (year of (current date) as text) & "-" & (month of (current date) as integer as text) & "-" & (day of (current date) as text) & "-" & (time string of (current date))
    tell application "Finder"
        set f to make new folder at POSIX file folderPath with properties {name:d}
        duplicate POSIX file "/Users/unimac/Desktop/output.csv" to f
    end tell
    try
        tell application "Finder"
            eject disk "Content SSD AA"
        end tell
    end try
end try

这篇关于AppleScript的错误"不能让\\""入式整数QUOT。 -1700号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆