使用applescript获取字符串的前几个字符
我希望在applescript中只保留字符串的前13个字符。我想我不明白如何使用“characters”功能。 有人能帮我吗使用applescript获取字符串的前几个字符,applescript,Applescript,我希望在applescript中只保留字符串的前13个字符。我想我不明白如何使用“characters”功能。 有人能帮我吗 choose from list {"0041325677667-pharmacie 1", "0041325677557-pharmacie 2", "0041325677447-pharmacie 3", "0041325677337-pharmacie 4"} with prompt "Thanks to select" without multiple sele
choose from list {"0041325677667-pharmacie 1", "0041325677557-pharmacie 2",
"0041325677447-pharmacie 3", "0041325677337-pharmacie 4"} with prompt
"Thanks to select" without multiple selections allowed and empty selection allowed
return the result as string
return characters 1 thru 13 of result
提前感谢您的帮助
字符x到y
返回字符列表,在您的示例中,项目1返回
{"0", "0", "4" ,"1" ,"3" ,"2" ,"5" ,"6" ,"7" ,"7" ,"6" ,"6", "7"}
文本x到y
根据请求返回字符串
默认情况下,不允许多个选择,允许空选择
,因此可以省略。但是,当用户按下“取消”时,应该考虑该情况,然后表达式返回布尔<代码> false <代码> > < /p>
set chosen to choose from list {"0041325677667-pharmacie 1", "0041325677557-pharmacie 2", "0041325677447-pharmacie 3", "0041325677337-pharmacie 4"} with prompt "Thanks to select"
if chosen is false then return "" -- in case of 'Cancel' return empty string
return text 1 thru 13 of (item 1 of chosen) -- as chosen returns a list by default it must be flattened