Questions tagged [rb-appscript]

36 questions
0
votes
1 answer

Rewriting MacTypes::FileURL from appscript-ruby to MacRuby ScriptingBridge

I have a script that automatically attaches a given PDF to a publication in BibDesk. Using appscript-rb, the following snippet works perfectly: BibDesk = Appscript.app('BibDesk') selection = BibDesk.document.selection.get[0] f =…
Stian Håklev
  • 1,240
  • 2
  • 14
  • 26
0
votes
1 answer

How can I use rb-appscript to drive Mac OS Finder's "Connect To Server" menu item

The end goal is to write an automated test in Ruby/Cucumber for connecting to a WebDAV server and testing authentication, CRUD and load/performance in Mac OS X. I'm trying to simulate user behavior as much as possible which is why I'm looking at…
mmla
  • 1,578
  • 19
  • 21
0
votes
0 answers

Email notification 60 days in advance for subscription renewal

I have a google sheet where I have a list of subscriptions, when the subscription will expire, and another column with the notice date (which is 60 days before the expiration date) so I know I have an upcoming renewal. I want to get email…
0
votes
0 answers

Convert New Date back to date format - Apps script

I have this code.. mainSheet.getRange(lastRow+1,2) .setValue(new Date().toLocaleString('en', {timeZone: 'America/New_York'})) .setNumberFormat("MM/dd/yyyy hh:mm:ss A/P") .setHorizontalAlignment("left") …
0
votes
0 answers

I am getting an error running this code loading data from excel sheet into google firebase using google cloud service account both of same mail

function getFirestore() { var email="busdata-account@export-815a4.iam.gserviceaccount.com"; var key = "-----BEGIN PRIVATE…
0
votes
0 answers

How I can do OAuth2 in my app on gmail App Script

We authorize a user visiting our website using OAuth2 and Google; We get hold of her/his access token that Google returns; There is a Google Apps Script web app that is executed as the user running the web app; We want to call this app (3) by…
0
votes
0 answers

Why does appscript code never stops running?

sorry for my english. I have this code and when I run it. it never stops and doesn't give any result. function valorAproximadoCompraMercadomacro() { var ss = SpreadsheetApp.getActiveSpreadsheet(); const hojapedidomercado=ss.getSheetByName("Hoja…
0
votes
1 answer

Bulk currency change within the whole Google Sheet

I have a "Currency" value cell on the "Cover page" tab with drop-down values "USD, EUR, GBP". What I need is to update the currency format for the whole document(more than 10 tabs with different ranges) by choosing currency value on the "Cover…
0
votes
1 answer

How to get path of currently selected file in Finder with rb-appscript in OSX Lion

In OSX 10.6 I used the following code to do something to each currently selected file in Finder: app('Finder').selection.get.each do |item| url =CGI::unescape(item.URL.get) puts url do_pdf(url[16..-1]) end (this is launched by Keyboard…
Stian Håklev
  • 1,240
  • 2
  • 14
  • 26
0
votes
2 answers

Segmentation fault issues (selenium-webdriver + rb-appscript)

I'm trying to automate webscraping, making use of both the selenium-webdriver and the ruby port of AppleScript rb-appscript. However, when I try to run the code I keep running into a segmentation fault. Code: require 'rubygems' require 'appscript';…
Kotsu
  • 374
  • 1
  • 5
  • 22
0
votes
1 answer

How Do I Activate a specific Safari Window using rb-appscript?

I can't get rb-appscript to activate a specific Safari window. It is always activating the most recently active window. (in irb, assuming rb-appscript is already installed) require 'appscript' include Appscript safari = app…
Radamanthus
  • 690
  • 2
  • 5
  • 17
0
votes
2 answers

How does one script the Keychain via rb-appscript?

I followed the docs and wrote: require 'rubygems' require 'appscript' loginKeychain = Appscript::app('Keychain Scripting').keychains['login.keychain'] userName = loginKeychain.keys[its.name.eq(name)].password.get UPDATE: if I run the script via…
Sean DeNigris
  • 6,306
  • 1
  • 31
  • 37
0
votes
1 answer

rb-appscript: Accessing parent reference?

Is there an easy way to find the parent element reference of a reference? For example, suppose I have the following reference: ref = app("System Events").processes["Safari"].windows[1].buttons[1] I would like to do something similar to the…
Thai Doan
  • 1
  • 1
0
votes
1 answer

Make new document in TextMate with rb-appscript or AppleScript?

How do I make a new document in TextMate using rb-appscript or AppleScript? Here is my rb-appscript: te = app("TextMate") te.launch doc = te.make(:new => :document) But it doesn't work. Here is the error message I get: OSERROR: -10000 …
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
0
votes
3 answers

How would I write the following rb-appscript in objc-appscript?

The documentation in the appscript objc-trunk randomly uses ruby in the section called "Performance Issues". require "appscript" include Appscript desiredEmail = 'sam.brown@foo.com' p app('Address Book').people[ …
demonslayer319
  • 936
  • 1
  • 10
  • 20