[3rd-Party Apps] 希望wps能支持zotero插件 Resolved
Tofloor
poster avatar
bigben446
deepin
2022-11-06 08:30
Author

zotero是一个非常好的文献管理软件,有linux、win和mac版本,在高校、研究所、医院使用非常多。是linux平台下面为数不多的优秀的文献管理软件,但是一直没有wps的zotero插件。

如果能有wps的zotero的插件,将linux平台下最好的文献管理软件zotero,和最好的文字编辑软件wps,结合在一起,可以很方便的解决linux平台下,文献管理和使用的痛点问题,一个插件效果立竿见影,造福广大的高校、研究所和医院用户,对linux的进一步推广和使用非常有帮助。

zotero网站:https://www.zotero.org/

Reply Favorite View the author
All Replies
q77190858
deepin
2022-11-06 16:36
#1

是的,现在zotero只能和libre office配合使用,而且官方没有支持wps计划,只能依靠社区了

Reply View the author
晚秋(lateautumn)
Moderator
2022-11-06 18:45
#2

我也学学这个zorero是个什么软件joy

Reply View the author
wtz
deepin
2022-11-06 20:08
#3

LO的插件是用Java做的吧,不知道WPS能不能做类似的扩展。

Reply View the author
bigben446
deepin
2022-11-06 20:16
#4
wtz

LO的插件是用Java做的吧,不知道WPS能不能做类似的扩展。

大概看了一下,估计只能以类*的形式给wps-linux弄zotero插件

其他几个都有zotero插件,比如office、libreoffice、google doc等等,唯独wps没有

如果有wps的zotero插件,立马解决了linux使用的一个痛点,影响范围很大,很多高校、研究所、医院用户,要想迁移到linux平台,必须要有一个很好的文献管理软件才行

Reply View the author
逃离喧嚣
deepin
2022-11-06 23:01
#5
晚秋(lateautumn)

我也学学这个zorero是个什么软件joy

哪儿都有你!😂

Reply View the author
wtz
deepin
2022-11-07 00:52
#6
bigben446

大概看了一下,估计只能以类*的形式给wps-linux弄zotero插件

其他几个都有zotero插件,比如office、libreoffice、google doc等等,唯独wps没有

如果有wps的zotero插件,立马解决了linux使用的一个痛点,影响范围很大,很多高校、研究所、医院用户,要想迁移到linux平台,必须要有一个很好的文献管理软件才行

Zotero在国内的影响力还是不及EndNote。

“收费的总比免费的好”。风气使然。

Reply View the author
xuqi
deepin testing team
2022-11-07 17:24
#7

👍

Reply View the author
zccrs
deepin
2022-11-07 22:35
#8

这得反馈给 wps 了,在这讨论估计没啥用。

Reply View the author
bigben446
deepin
2022-11-08 02:29
#9
zccrs

这得反馈给 wps 了,在这讨论估计没啥用。

很早就和wps说了,wps不理。。。

Reply View the author
q77190858
deepin
2022-11-08 18:34
#10

感觉可以自己用js写一个,看了一下word插件vba源代码,就是查找zotero进程然后传递参数弹出插入文献的窗口,代码不长,也比较简单



' ***** BEGIN LICENSE BLOCK *****
'
' Copyright (c) 2015  Zotero
'                     Center for History and New Media
'                     George Mason University, Fairfax, Virginia, USA
'                     http://zotero.org
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program.  If not, see .
'
' ***** END LICENSE BLOCK *****

Option Explicit

Private Const CP_UTF8 = 65001
Private Const WM_COPYDATA = &H4A

#If VBA7 Then
    Type COPYDATASTRUCT
        dwData As LongPtr
        cbData As Long
        lpData As LongPtr
    End Type
    Private Declare PtrSafe Function FindWindow Lib "user32" Alias _
        "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName _
        As String) As LongPtr
    Private Declare PtrSafe Function SendMessage Lib "user32" Alias _
        "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal _
        wParam As Long, lParam As Any) As Integer
    Private Declare PtrSafe Function SetForegroundWindow Lib "user32" _
        (ByVal hwnd As LongPtr) As Boolean
    Private Declare PtrSafe Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, _
        ByVal dwflags As Long, ByVal lpWideCharStr As LongPtr, _
        ByVal cchWideChar As Long, lpMultiByteStr As Any, _
        ByVal cchMultiByte As Long, ByVal lpDefaultChar As Long, _
        ByVal lpUsedDefaultChar As Long) As Long
#Else
    Type COPYDATASTRUCT
        dwData As Long
        cbData As Long
        lpData As Long
    End Type
    Private Declare Function FindWindow Lib "user32" Alias _
        "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName _
        As String) As Long
    Private Declare Function SendMessage Lib "user32" Alias _
        "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal _
        wParam As Long, lParam As Any) As Integer
    Private Declare Function SetForegroundWindow Lib "user32" _
        (ByVal hwnd As Long) As Boolean
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
        (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
    Private Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, _
        ByVal dwflags As Long, ByVal lpWideCharStr As Long, _
        ByVal cchWideChar As Long, lpMultiByteStr As Any, _
        ByVal cchMultiByte As Long, ByVal lpDefaultChar As Long, _
        ByVal lpUsedDefaultChar As Long) As Long
#End If

Public Sub ZoteroInsertCitation()
    Call ZoteroCommand("addCitation", True)
End Sub

Public Sub ZoteroInsertBibliography()
    Call ZoteroCommand("addBibliography", False)
End Sub

Public Sub ZoteroEditCitation()
    Call ZoteroCommand("editCitation", True)
End Sub

Public Sub ZoteroEditBibliography()
    Call ZoteroCommand("editBibliography", True)
End Sub

Public Sub ZoteroAddEditCitation()
    Call ZoteroCommand("addEditCitation", True)
End Sub

Public Sub ZoteroAddNote()
    Call ZoteroCommand("addNote", True)
End Sub

Public Sub ZoteroAddEditBibliography()
    Call ZoteroCommand("addEditBibliography", True)
End Sub

Public Sub ZoteroSetDocPrefs()
    Call ZoteroCommand("setDocPrefs", True)
End Sub

Public Sub ZoteroRefresh()
    Call ZoteroCommand("refresh", False)
End Sub

Public Sub ZoteroRemoveCodes()
    Call ZoteroCommand("removeCodes", False)
End Sub


Sub ZoteroCommand(cmd As String, bringToFront As Boolean)
    Dim cds As COPYDATASTRUCT
    #If VBA7 Then
        Dim ThWnd As LongPtr
    #Else
        Dim ThWnd As Long
    #End If
    Dim a$, args$, name$, templateVersion$
    Dim i As Long
    Dim ignore As Long
    Dim sBuffer$
    Dim lLength As Long
    Dim buf() As Byte
  
    ' Try various names for Firefox
    Dim appNames(5)
    appNames(1) = "Zotero"
    appNames(2) = "Firefox"
    appNames(3) = "Browser"
    appNames(4) = "firefox-dev"
    For i = 1 To 4
        ThWnd = FindWindow(appNames(i) & "MessageWindow", vbNullString)
        If ThWnd <> 0 Then
            Exit For
        End If
    Next
    If ThWnd = 0 Then
        MsgBox ("Word could not communicate with Zotero. Please ensure Zotero is running and try again. If this problem persists, see https://www.zotero.org/support/word_processor_plugin_troubleshooting")
        Exit Sub
    End If
  
    ' Allow Firefox to bring a window to the front
    If bringToFront Then Call SetForegroundWindow(ThWnd)
  
    ' Get path to active document
    If ActiveDocument.Path <> "" Then
        name$ = ActiveDocument.Path & Application.PathSeparator & ActiveDocument.name
    Else
        name$ = ActiveDocument.name
    End If
  
    templateVersion$ = 1
  
    ' Set up command line arguments
    name$ = Replace(name$, """", """""")
    args$ = "-silent -ZoteroIntegrationAgent WinWord -ZoteroIntegrationCommand " & cmd & " -ZoteroIntegrationDocument """ & name$ & """ -ZoteroIntegrationTemplateVersion " & templateVersion$
    a$ = "firefox.exe " & args$ & Chr$(0) & "C:\"
  
    ' Do some UTF-8 magic
    lLength = WideCharToMultiByte(CP_UTF8, 0, StrPtr(a$), -1, ByVal 0, 0, 0, 0)
    ReDim buf(lLength) As Byte
    Call WideCharToMultiByte(CP_UTF8, 0, StrPtr(a$), -1, buf(1), lLength, 0, 0)
  
    ' Send message to Firefox
    cds.dwData = 1
    cds.cbData = lLength
    cds.lpData = VarPtr(buf(1))
    i = SendMessage(ThWnd, WM_COPYDATA, 0, cds)
  
    ' Handle error
    If Err.LastDllError = 5 Then
        If Dir("C:\Program Files\Mozilla Firefox\firefox.exe") <> "" Then
            Call Shell("""C:\Program Files\Mozilla Firefox\firefox.exe"" " & args$, vbNormalFocus)
        ElseIf Dir("C:\Program Files (x86)\Mozilla Firefox\firefox.exe") <> "" Then
            Call Shell("""C:\Program Files (x86)\Mozilla Firefox\firefox.exe"" " & args$, vbNormalFocus)
        End If
    End If
End Sub


Reply View the author
zccrs
deepin
2022-11-08 21:12
#11
bigben446

很早就和wps说了,wps不理。。。

Reply View the author
zhangqf
deepin
2022-12-29 05:48
#12

windows下似乎已经有解决方案了:

https://zhuanlan.zhihu.com/p/580205995

https://zhuanlan.zhihu.com/p/579975093

但是linux版的WPS应该是不支持VBA的😭

Reply View the author
Tankwyn
deepin
2023-09-10 17:14
#13

欢迎测试wps的zotero插件

https://github.com/tankwyn/WPS-Zotero

Reply View the author
bigben446
deepin
2023-09-11 05:36
#14
Tankwyn

欢迎测试wps的zotero插件

https://github.com/tankwyn/WPS-Zotero

太厉害了你,linux下的wps测试了一下,确实可以插入,解决了我们很大的问题,太赞了!

以前自己折腾过,和wps linux反应过,和zotero反映过,都没解决问题,你一个人直接搞定了!

以前我们建了一个相关的信息页:

https://github.com/l0o0/Zotero-WPS

deepin/uos官方的软件商城应该把你这插件收录进去,太好了,非常感谢!

Reply View the author
Tankwyn
deepin
2023-09-11 17:53
#15
bigben446

太厉害了你,linux下的wps测试了一下,确实可以插入,解决了我们很大的问题,太赞了!

以前自己折腾过,和wps linux反应过,和zotero反映过,都没解决问题,你一个人直接搞定了!

以前我们建了一个相关的信息页:

https://github.com/l0o0/Zotero-WPS

deepin/uos官方的软件商城应该把你这插件收录进去,太好了,非常感谢!

谢谢支持,本来也是为了解决自己的需要,我自己也正在用,顺带分享给大家,有问题就到github上反馈,我会尽快修复。

Reply View the author
bigben446
deepin
2024-12-28 11:32
#16

Zotero-WPS插件

1、wangrui5015修改版本,可以使用最新版本的Win、linux、mac版本WPS:

https://gitee.com/wangrui5015/Zotero-WPSJS

2、原来tankwyn版本,只能使用旧版本WPS(Win和linux),不能使用最新版本WPS:

https://github.com/tankwyn/WPS-Zotero

Reply View the author