无效的键形式applescript
我在一个我正在处理的程序中有以下代码无效的键形式applescript,applescript,Applescript,我在一个我正在处理的程序中有以下代码 set outPath to "/Users/student/Desktop/Accounts.txt" set x to text returned of (display dialog "Username" default answer "") set y to text returned of (display dialog "Password" default answer "") set RAccounts to (read POSIX file
set outPath to "/Users/student/Desktop/Accounts.txt"
set x to text returned of (display dialog "Username" default answer "")
set y to text returned of (display dialog "Password" default answer "")
set RAccounts to (read POSIX file "/Users/student/Desktop/Accounts.txt")
if file path outPath exists
then
get word 1
else
然后它继续运行,但每当我试图编译它时,它都会给我以下错误
无效的密钥格式
有什么帮助吗?试试:
set outPath to "/Users/student/Desktop/Accounts.txt"
set x to text returned of (display dialog "Username" default answer "")
set y to text returned of (display dialog "Password" default answer "")
try
set RAccounts to read POSIX file outPath
on error
-- file outPath does not exist … do things
end try
或
tell application "Finder"
if exists POSIX file "/Users/student/Desktop/Accounts.txt" then
beep
else
beep 2
end if
end tell