开头我就要跟各位先说对不起,本来我是很想为大家把这部分实现并完成的。但是很抱歉,因为我用的Mac,而这部分代码实现起来的时候一直会如下报错:

这篇文章就算鸽了大家吧,当然,作为补偿,我将我自己实现过的代码贴在这里给大家做个参考,请注意,这是AppleScript的代码,请谨慎使用:
- Step 1: Prompt to choose Excel fileset excelFile to choose file with prompt "Select Excel File"
- Step 2: Open Excel file and get worksheettell application "Microsoft Excel" activate open excelFile set excelWorkbook to workbook 1 set excelSheet to sheet 1 of excelWorkbook - Step 3: Read first column and process each product titleset productTitles to value of column 1 of excelSheet set translatedResults to {} repeat with i from 1 to count of productTitles set productTitle to item i of productTitles set promptText to "Consideration product: " & productTitle & return & ¬ "1. Compose human readable product title used on Amazon in English within 20 words." & return & ¬ "2. Write 5 selling points for the products on Amazon." & return & ¬ "3. Evaluate a price range for this product in the U.S." - Step 4: Call OpenAI API and get translated resultset translatedResult to my callOpenAPI(promptText) copy translatedResult to the end of translatedResults end repeat - Step 5: Write translated results to second columnset column 2 of excelSheet to translatedResults - Step 6: Save and close Excel filesave excelWorkbook close excelWorkbook
end tellon callOpenAPI(promptText) - Call OpenAI API and return translated result- Replace this code with actual API callset translatedResult to "Translated Result" - Replace with actual translated resultreturn translatedResult
end callOpenAPI
最后,在和大家说声抱歉。咱们下期,来尝试用AI帮忙来写测试。


















