appscript

How to convert Date (from google sheet data) to TimeStamp (Firestore) using AppScript?

亡梦爱人 提交于 2020-06-16 17:24:28
问题 I've got a date object in Google Sheet which I want to import to firestore as a timestamp object, but it doesn't work when I do it directly. If I enter the current date, data.date = new Date(dateSt); it stores an empty map object in firestore. What should I do to convert the date object to timestamp. Full Code: function classRoutineFunction() { const email = "my_email"; const key = "my_private_key"; const projectId = "my_projectID"; var firestore = FirestoreApp.getFirestore (email, key,

Convert date object from Google sheets (javaScript) to Firebase time stamp using AppScript

时光总嘲笑我的痴心妄想 提交于 2020-06-09 05:20:04
问题 I've got a date object in Google Sheet which I want to import to firestore as a timestamp object, but it doesn't work when I do it directly.I am using JavaSript in the Appscript. This stores an empty map in firestore: data.date = new Date(); What should I do to convert the date object to timestamp. This is my full code function uploadData() { var firestore = FirestoreApp.getFirestore (email, key, projectId); var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheetname = "Sheet1"; var sheet =

Is it possible to reduce the startup time of MacRuby scripts which use the ScriptingBridge?

痞子三分冷 提交于 2019-12-23 04:19:35
问题 I would like to use MacRuby with ScriptingBridge instead of AppleScript to control Mac applications which support AppleScript. I used to do this using appscript, which is effectively deprecated, hence the move the MacRuby and scripting bridge. The only problem I have is that the ScriptingBridge framework takes about a second to load, even on a fast machine with a fast SSD. For example, this simple script takes about 0.9 seconds to run, with almost of the time spend loading the ScriptingBridge

AppleScript from Java on Mac OS X 10.6?

心不动则不痛 提交于 2019-12-19 10:16:55
问题 To call AppleScript from Python, I use the "appscript" bridge: http://appscript.sourceforge.net/ What can I use to call AppleScript from Java on Mac OS X 10.6+? 回答1: Here's an approach that works for me for Java on Mac OS X 10.6+. This example script fetches the creation date of the current folder: import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.io.File; import java.util.Date; import java.util.GregorianCalendar;

appscript on OSX 10.6.3 / Python 2.6.1

柔情痞子 提交于 2019-12-12 18:23:31
问题 I am having some trouble getting appscript installed on OS/X 10.6.3 / Python 2.6.1. When I issue sudo easy_install appscript I get "unable to execute gcc-4.2: No such file or directory". Even when I do export CC=/Developer/usr/bin/gcc-4.2 (a valid gcc-4.2 executable), easy_install barks. What could be the issue? Disclaimer: OS/X newbie at the helm... 回答1: Rerun the Xcode installer and check "UNIX Development" - it will put compilers in /usr/bin in addition to /Developer. 回答2: I don't think

Translate Applescrip [key code 125 using command down] to appscript

孤者浪人 提交于 2019-12-12 01:35:10
问题 how to translate the following Applescript to appscript: tell application "System Events" key code 0 using command down end tell I want to perform "Command + A"-like short cut, i.e., select all texts. 回答1: Look at the application ASTranslate which was installed as part of Appscript. It translates Applescript to Appscript for Python or Ruby. Be aware it just traps Apple Events and thus won't translate Applescript structures like loops or the like. It's very easy to use. Just past your

AppleScript from Java on Mac OS X 10.6?

Deadly 提交于 2019-12-01 11:12:37
To call AppleScript from Python, I use the "appscript" bridge: http://appscript.sourceforge.net/ What can I use to call AppleScript from Java on Mac OS X 10.6+? Here's an approach that works for me for Java on Mac OS X 10.6+. This example script fetches the creation date of the current folder: import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.io.File; import java.util.Date; import java.util.GregorianCalendar; public class ScratchSpace { public static void main(String[] args) throws ScriptException { System.out.println(