Applescript 删除特殊字符
我需要使用applescript将其转换为字符串:Applescript 删除特殊字符,applescript,Applescript,我需要使用applescript将其转换为字符串: \", \"resource_id\ 我发现的问题是“\”用于告诉applescript引号是字符串的一部分 关于如何将整组字符转换为applescript字符串,您有什么想法吗 Loren反斜杠用作AppleScript字符串中特殊字符(引号)的转义字符,因此要在字符串中使用转义字符,还必须对其进行转义。因此,您的转义字符串将是: set theString to "\\\", \\\"resource_id\\" 您可以使用ASCII码
\", \"resource_id\
我发现的问题是“\”用于告诉applescript引号是字符串的一部分
关于如何将整组字符转换为applescript字符串,您有什么想法吗
Loren反斜杠用作AppleScript字符串中特殊字符(引号)的转义字符,因此要在字符串中使用转义字符,还必须对其进行转义。因此,您的转义字符串将是:
set theString to "\\\", \\\"resource_id\\"
您可以使用ASCII码代替反斜杠字符和引号字符:
tell application "Finder"
activate
set bSlash to (ASCII character 92) ---> sets the variable bSlash to \
set qMark to (ASCII character 34) ---> sets the variable qMark to "
set theString to bSlash & qMark & ", " & bSlash & qMark & "resource_id" & bSlash ---> sets the variable theString to \", \"resource_id\
display dialog theString
end tell
除非我误解了你的需要——但无论如何,你知道我要做什么