Announcing the new Datavyu v1.3.6 with enhanced features and transcription support!

Hi,

Is it possible to access data from the gui (e.g. filename of the loaded movie, name of currently opened project-file,...) in a ruby-script? I didn't find anything in the documentation. I want to add data to the spreadsheet from a csv-file and determine the filename of that csv-file based on the filename of (a) currently loaded movie(s). Or alternatively based on the name of the current project-file.

greetings, Manuel

asked 04 Jun '14, 07:57

manuel's gravatar image

manuel
6112
accept rate: 0%


$pj.getProjectName
$pj.getProjectDirectory

I'd advise writing a script to loop over files in a directory rather than accessing currently opened file (if you need to import on multiple files to import data, having a batched import script will save you a significant amount of time). But if that's not feasible, above two lines will get you the name and directory of currently opened file or nil if none are open.

permanent link

answered 06 Jun '14, 15:40

Shohan%20Hasan's gravatar image

Shohan Hasan ♦♦
381126
accept rate: 11%

edited 06 Jun '14, 15:43

Thanks for answer and advice. You pointed me to the right direction. To get the filename of the first loaded Moviefile I do the following:

$viewers.getDataViewers().toArray()[0].getDataFeed().getAbsolutePath()

Not pretty, I guess, but I have a hunch that it will be more comfortable for us compared to batched import.

permanent link

answered 11 Jun '14, 04:40

manuel's gravatar image

manuel
6112
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×46
×18
×13
×4

question asked: 04 Jun '14, 07:57

question was seen: 3,033 times

last updated: 11 Jun '14, 04:40

powered by OSQA