
Untitled
By: a guest on
Apr 30th, 2012 | syntax:
None | size: 0.91 KB | hits: 15 | expires: Never
Rewriting MacTypes::FileURL from appscript-ruby to MacRuby ScriptingBridge
BibDesk = Appscript.app('BibDesk')
selection = BibDesk.document.selection.get[0]
f = MacTypes::FileURL.path(curfile)
selection[0].linked_files.add(f,{:to =>Selection[0]})
selection[0].auto_file
framework 'Cocoa'
framework 'ScriptingBridge'
file=NSURL.fileURLWithPath("file:///Users/Stian/Downloads/Telearn.pdf")
dt=SBApplication.applicationWithBundleIdentifier("edu.ucsd.cs.mmccrack.bibdesk")
d= dt.documents[0].selection[0]
d.linkedFiles.add(file,[:to=>dt.documents[0].selection[0]])
84829 abort macruby attach_bibdesk.rb
framework 'Cocoa'
framework 'ScriptingBridge'
file_path = NSURL.fileURLWithPath("/Users/Stian/Downloads/Telearn.pdf")
bib_desk = SBApplication.applicationWithBundleIdentifier("edu.ucsd.cs.mmccrack.bibdesk")
selected_doc = bib_desk.documents.first.selection.first
bib_desk.add(file_path, to:selected_doc)