ส่งออกแท็กจาก Evernote เท่านั้น?

ฉันพบสิ่งนี้: การใช้ Applescript เพื่อส่งออกรายการ URL ตาม บนแท็ก ซึ่งเป็นแหล่งข้อมูลที่ดี สคริปต์ต้นฉบับ (จาก Veritrope) อาจจะเก่าไปหน่อย แต่ใช้งานได้ดีในการส่งออกชื่อบันทึกย่อของ Evernote ฉันคิดว่าการแก้ไขสคริปต์นี้เพื่อเอาเพียงแท็กในสมุดบันทึกของฉันไปเป็น CSV คงจะค่อนข้างง่าย แต่เนื่องจากฉันเป็นมือสมัครเล่นในการเขียนสคริปต์และเรียนรู้ด้วยตนเองในเรื่องนี้ ฉันจึงไม่สามารถทำงานได้

ใครสามารถชี้ฉันไปในทิศทางที่ถูกต้อง? เป้าหมายสูงสุดของฉันคือการบำรุงรักษาแท็ก เนื่องจากตอนนี้ฉันมีแท็กมากมายจนไม่มีประโยชน์อีกต่อไป ฉันแค่ต้องการรายการแท็ก - ไม่จำเป็นต้องเชื่อมโยงกับบันทึกย่อ ข้อมูลหนึ่งคอลัมน์

ขอบคุณสแต็คกี้


person SteveS    schedule 07.07.2015    source แหล่งที่มา
comment
ใครช่วยอธิบายได้ไหมว่าทำไมสิ่งนี้ถึงถูกโหวต? สิ่งนี้และคำถามสุดท้ายของฉันถูกแพนโดยไม่มีคำอธิบายใดๆ ชุมชนนี้ดูเหมือนจะไม่อดทนมากขึ้น ฉันไม่เข้าใจ ฉันแค่พยายามเรียนรู้   -  person SteveS    schedule 20.07.2015
comment
คำถามของคุณถูกลดระดับลงเนื่องจากคุณไม่ได้ถามคำตอบเฉพาะเจาะจงสำหรับคำถามใดคำถามหนึ่งโดยเฉพาะ คำถามเกี่ยวกับแบบฟอร์ม ฉันจะทำ X ได้อย่างไร? หรือคุณช่วยชี้ทิศทางที่ถูกต้องให้ฉันได้ไหม? โดยทั่วไปแล้วทำงานได้ไม่ดีนักบน StackOverflow คุณถูกคาดหวังให้ทำการค้นคว้าและพยายามอย่างเต็มที่เพื่อค้นหาวิธีแก้ปัญหาด้วยตนเองก่อนที่จะถามคำถามที่นี่ stackoverflow.com/help/how-to-ask   -  person matthewayne    schedule 29.07.2015
comment
ขอบคุณ. ไอ้หนู ชุมชนนี้เข้าใจยาก!! จริงๆ แล้วฉันได้ค้นคว้าเกี่ยวกับเรื่องนี้มามากมาย และถึงขั้นพยายามดัดแปลงสคริปต์ที่ฉันพบด้วยตัวเองด้วยซ้ำ ฉันคิดว่าฉันไม่ได้ถามวิธีที่ถูกต้อง ถ้อยคำ, ลาน่า. ยังไงก็ขอบคุณสำหรับสคริปต์ด้านล่างเช่นกัน จะไปลองตอนนี้   -  person SteveS    schedule 30.07.2015


คำตอบ (1)


นี่คือโปรแกรม AppleScript ที่จะทำสิ่งที่คุณต้องการ:

tell application "Evernote"
    set tagList to {}
    set allNotebooks to every notebook
    repeat with currentNotebook in allNotebooks
        set allNotes to every note in currentNotebook
        repeat with currentNote in allNotes
            set noteTags to (the tags of currentNote)
            repeat with currentTag in noteTags
                if tagList does not contain name of currentTag then
                    set the end of tagList to name of currentTag

                end if
            end repeat
        end repeat
    end repeat
end tell

set filePath to (path to desktop as text) & "Evernote Tags.csv"
set output to ""
repeat with currentTag in tagList
    set output to output & currentTag & ", "
end repeat

set theResult to writeTo(filePath, output, text, false)
if not theResult then display dialog "There was an error writing the data!"

on writeTo(targetFile, theData, dataType, apendData)
    -- targetFile is the path to the file you want to write
    -- theData is the data you want in the file.
    -- dataType is the data type of theData and it can be text, list, record etc.
    -- apendData is true to append theData to the end of the current contents of the file or false to overwrite it
    try
        set targetFile to targetFile as text
        set openFile to open for access file targetFile with write permission
        if apendData is false then set eof of openFile to 0
        write theData to openFile starting at eof as dataType
        close access openFile
        return true
    on error
        try
            close access file targetFile
        end try
        return false
    end try
end writeTo
person matthewayne    schedule 29.07.2015