我已经从https://developers.google.com/apps-script/api/how-tos/execute复制了此代码,但是我的IDE告诉我,方法(在methode getScriptService()中)未被识别。
PS: 另外,我手动添加了APPLICATION_NAME,JSON_FACTORY,HTTP_TRANSPORT,TOKENS_DIRECTORY_PATH字段,因为未指定它们并导致错误。 / 在这里编码 /
public static Script getScriptService() throws IOException,GeneralSecurityException
{
final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
Credential credential=authorize();
return new Script.Builder(HTTP_TRANSPORT, JSON_FACTORY, setHttpTimeout(credential)).setApplicationName(APPLICATION_NAME).build();
}