Please use our GitHub Issues page for all new support inquiries. If you need to contact us directly, please e-mail [email protected]

I've modified an existing script for exporting data. When I run the script, I get this error:

** SCRIPT ERRROR ** @Line -1:'org.jruby.exceptions.RaiseException: undefined method `get_database' for #<java::orgopenshapacontrollers::openc:0x8b6cca>'

What does it mean? What do I change in the script?

asked 10 Dec '11, 04:08

LanaKarasik's gravatar image

accept rate: 0%

Can you attach the script (from begin to end)?

(11 Dec '11, 05:04) JohnFranchak ♦ JohnFranchak's gravatar image

We can't add attachments yet - but copying and pasting the whole script into your question will be enough.

(12 Dec '11, 11:57) Clinton Clinton's gravatar image

Hi John and Clinton, thank you for responding! I've run the script in 1.11 version instead of 2.00 and it worked--no error. Here's the script:

How do I ask to export onsets & offsets??

begin filedir = "/Volumes/LABDOCS/StudiesCurrent/FirstSteps/Studies/FS_SupportWalk/Coding_LocSkill/Export/" filenames =

dir = File.expand_path("~/Desktop")
out_file = + "/Data.txt", "w")

for file in filenames if file.include?(".opf") and file[0].chr != '.'

  puts "LOADING DATABASE: " + filedir+file
  $db,proj = load_db(filedir+file)

  id = getVariable("id")
  locassess = getVariable("locassess")

  for idcell in id.cells
    for locassesscell in locassess.cells
      if locassesscell.onset >= idcell.onset and locassesscell.offset <= idcell.offset
        out_file.syswrite ( + "\t" + + "\t" + idcell.sess + "\t" + idcell.loctyp + "\t" + locassesscell.ordinal.to_s + "\t" + locassesscell.steps + "\t" + locassesscell.dist + "\t" + locassesscell.onset.to_s + "\t" + locassesscell.offset.to_s +  "\n")




(13 Dec '11, 08:14) LanaKarasik LanaKarasik's gravatar image

If you want to export the onset and offset, add:

locassesscell.onset.to_s locassesscell.offset.to_s

before locassesscell.ordinal.to_s or wherever you want in the out_file.syswrite command. Onsets and offsets are accessed just like every other argument, but you need to add ".to_s" to convert to strings so that you can write to text.

Just to be clear, the script works fine in 1.11, so there's nothing we need to do to address the script that you have right now?

permanent link

answered 16 Dec '11, 06:23

JohnFranchak's gravatar image

JohnFranchak ♦
accept rate: 17%

Yes, thank you John, the script seems to work in 1.11 and the onsets/offsets get exported!


(18 Dec '11, 23:28) LanaKarasik LanaKarasik's gravatar image

Hi Lana, If this answer worked for you, you can select the 'tick' on the left hand side to mark this answer as correct - this way others can quickly glance and figure out what worked for the person who asked the original question.

(19 Dec '11, 13:52) Clinton Clinton's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 10 Dec '11, 04:08

question was seen: 5,016 times

last updated: 19 Dec '11, 13:52

powered by OSQA