AppleScript有语法错误,因为引号,如何修复它?



谢谢你的帮助。如果代码在列R

中找到我要找的曲目标题,我将尝试更改列N中包含音乐曲目子类别的单元格
-- Declare variables
property searchTrackTitle : ""
property newSubCategory : ""
-- Display input box to get search term
display dialog "Enter the track title that you want to search for:" default answer ""
set searchTrackTitle to text returned of result
-- Display input box to get new SubCategory
display dialog "Enter the new SubCategory that you want to use:" default answer ""
set newSubCategory to text returned of result
-- Open Excel and set variables
tell application "Microsoft Excel"
activate
set sh to active sheet
set rng to range "R:R" of sh
end tell
-- Loop through each cell in the range
repeat with cell in rng
-- Check if the cell value matches the search term
if value of cell is searchTrackTitle then
-- Update the keywords for the track title
set value of cell "N" of sh to newSubCategory
end if
end repeat

你把"end tell"在Excel中的工作结束之前,您尝试将变量分配给类名称正确代码:

-- Declare variables
property searchTrackTitle : ""
property newSubCategory : ""
-- Display input box to get search term
display dialog "Enter the track title that you want to search for:" default answer ""
set searchTrackTitle to text returned of result
-- Display input box to get new SubCategory
display dialog "Enter the new SubCategory that you want to use:" default answer ""
set newSubCategory to text returned of result
-- Open Excel and set variables
tell application "Microsoft Excel"
activate
set sh to active sheet
set rng to range "R:R" of sh

-- Loop through each cell in the range
repeat with currentCell in rng
-- Check if the cell value matches the search term
if value of currentCell is searchTrackTitle then
-- Update the keywords for the track title
set value of cell "N" of sh to newSubCategory
end if
end repeat
end tell

相关内容

最新更新