Page 1 of 1

How to get currently editing block name in Script Shell

Posted: Sat Dec 07, 2019 3:59 pm
by dfriasb
Dear all,

I can't find the way to get the Id of the block that I am editing right now. I have all the block Ids with these line:

Code: Select all

var blockIds = document.queryAllBlocks();
Then I should find "currently editing" block somehow...
And then apply:

Code: Select all

var block = document.queryBlock(blockId);
var blockName = block.getName();
where block is the blockId that I'm looking for.

I'm also asking myself if document variable definition line should be diferent. I'm writing this one:

Code: Select all

var document = this.getDocument();
or

Code: Select all

var document = this.getDocumentInterface();
Does exist any getBlockDocument like? I mean get document entities only inside some block...

Any help will be very welcomed!

Re: How to get currently editing block name in Script Shell

Posted: Tue Dec 10, 2019 2:25 pm
by andrew
dfriasb wrote:
Sat Dec 07, 2019 3:59 pm
I can't find the way to get the Id of the block that I am editing right now.

Code: Select all

var blockId = doc.getCurrentBlockId();
dfriasb wrote:
Sat Dec 07, 2019 3:59 pm
I mean get document entities only inside some block...

Code: Select all

doc.queryBlockEntities(blockId);