-
Notifications
You must be signed in to change notification settings - Fork 6
/
GetColumnValue.ouc
28 lines (28 loc) · 1.45 KB
/
GetColumnValue.ouc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>GetColumnValue</label>
<tip>Get the value of the specified column to glob:result</tip>
<template>COLUMN</template>
<icon1>#usercommand</icon1>
<function type="normal">
<instruction>// Author: @Chaoses-Ib</instruction>
<instruction>// Version: 231101</instruction>
<instruction>// Homepage: https://github.com/Chaoses-Ib/IbDOpusScripts</instruction>
<instruction />
<instruction>// @set can't set an empty variable</instruction>
<instruction>@set glob:result</instruction>
<instruction>// SCRIPTARG doesn't work</instruction>
<instruction>Rename PATTERN * TO "&COLUMN&"</instruction>
<instruction>@script:jscript</instruction>
<instruction>function OnGetNewName(getNewNameData)</instruction>
<instruction>{</instruction>
<instruction> if (!DOpus.vars.Exists("result"))</instruction>
<instruction> DOpus.vars.Set("result", getNewNameData.newname);</instruction>
<instruction> else</instruction>
<instruction> DOpus.vars.Set("result", DOpus.vars.Get("result") + '\n' + getNewNameData.newname);</instruction>
<instruction> return true; // prevent rename</instruction>
<instruction>}</instruction>
<instruction>// Access the result by `{$glob:result}`</instruction>
<instruction>// Delete the result by `@set glob:result`</instruction>
</function>
</button>