-
Notifications
You must be signed in to change notification settings - Fork 9
/
PagesCount.vbs
53 lines (44 loc) · 1.44 KB
/
PagesCount.vbs
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
option explicit
' Document pages count
' (c) 2020 qiuqiu
' Called by Directory Opus to initialize the script
Function OnInit(initData)
Dim props
Set props = DOpus.FSUtil.GetShellPropertyList("System.Document.PageCount", "r")
with initData
.name = "Document pages count"
.version = "1.0"
.copyright = "qiuqiu"
.desc = DOpus.Strings.Get("ScriptDesc")
.url = "http://script.dopus.net/"
.default_enable = True
.min_version = "12.0.8"
with .AddColumn
.name = props(0).raw_name
.method = "On_DocPages"
.label = DOpus.Strings.Get("ColumnLabel")
.justify = props(0).justify
.type = props(0).Type
.autogroup = True
.autorefresh = True
.userdata = props(0).pkey
end with
end with
End Function
' Implement the DocPages column
Function On_DocPages(scriptColData)
scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)
End Function
==SCRIPT RESOURCES
<resources>
<resource type = "Strings">
<Strings lang = "english">
<string id = "ScriptDesc" text = "Add the document page number column in the shell extension." />
<string id = "ColumnLabel" text = "Pages" />
</Strings>
<Strings lang = "chs">
<string id = "ScriptDesc" text = "添加外壳扩展中的文档页数列." />
<string id = "ColumnLabel" text = "页数" />
</Strings>
</resource>
</resources>