У меня есть переменная, которая содержит {«ЭТО», «ЧТО»}, которую я пытаюсь записать в csv, так что форматы csv как ЭТО, ЭТО. Текущее это просто выплевывается как ЭТОТ.Applescript преобразовать переменную в строку с запятыми для CSV
Я думаю, что нужно повторить хотя переменной, но я не уверен ...
код выглядит следующим образом (проверьте ---> для важных битов):
tell application "Adobe InDesign CC 2014"
delete unused swatches of document 1
set _NotUSED to {"None", "Paper", "Black", "Registration", "Keyline", "ImageLabel", "C=0 M=0 Y=0 K=37", "C=0 M=100 Y=100 K=0", "Map this to white ->", "Dieline", "C=0 M=100 Y=0 K=0"} as string
try
---> Get the variables
set _UpDatedList to get (name of swatches of document 1 whose name is not in _NotUSED)
on error
display alert {"Your document has no spot colours"}
end try
end tell
set filePath to (path to desktop as text) & "Pantones.csv"
---> Set the theString to the variables
set theString to _UpDatedList as string
set theResult to writeTo(filePath, theString, text, false)
if not theResult then display dialog "There was an error writing the data!"
on writeTo(targetFile, theData)
try
set openFile to open for access file targetFile with write permission
---> write the variables to csv
write theData to openFile
close access openFile
return true
on error
try
close access file targetFile
end try
return false
end try
end writeTo