Re: [TeX works script] Comando per inserire data

#86100
robitex
Amministratore del forum
    Up
    0
    Down
    ::


    E va bene mi rispondo da solo…
    `–[[TeXworksScript
    Title: Insert &date (lua)
    Description: Insert date in the source file as comment
    Author: Roberto Giacomelli
    Version: 0.0.1
    Date: 2013-05-27
    Script-Type: standalone
    Context: TeXDocument
    Shortcut: Ctrl+J, Ctrl+M
    ]]

    local tdata = os.date(“*t”)
    local g, m, a = tdata.day, tdata.month, tdata.year
    local today = string.format(“%d/%02d/%d”, g, m, a)

    local h, m, s = tdata.hour, tdata.min, tdata.sec
    local time = string.format(“%02d:%02d:%02d”, h, m, s)

    msg = string.format(“\n%% data: %s ora: %s\n”, today, time)

    TW.target.insertText(msg)`

    Forte però…
    🙂
    R.

    Go to top