topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday December 9, 2024, 9:01 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Farr's ADDNOTE  (Read 8166 times)

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Farr's ADDNOTE
« on: March 12, 2006, 03:57 PM »
Hello,

Mouser asked me an addnote tool for his Farr tool...
Here's the beast that can be compiled there : http://gedd123.free..../studio/fbsl2exe.php

' // ------------------------------------------------------------------
' // Addnote -clip|-timestamp|-top YOURMESSAGE_UNDERSCORES_MEAN_CRLF :)
' // ------------------------------------------------------------------

Dim $szCmd1, $szCmdFull, %fp, $szTemp
Begin Const
    file = ".\addnote.txt"
    sepa = "------------------------------------"
End Const

If STANDALONE = TRUE Then
    szCmd1 = LCase(Command(1))
    szCmdFull = Remove(Command(-1), szCmd1)
    szCmdFull = Replace(szCmdFull, "_", CRLF)
    szCmdFull = Trim(szCmdFull)
   
    szCmdFull = Replace(szCmdFull, ch34 & ch34, "")
    If Left(szCmdFull, 1) = ch34 AndAlso Right(szCmdFull, 1) = ch34 Then szCmdFull = Mid(szCmdFull, 2, StrLen(szCmdFull) - 2)
    szCmdFull = Trim(szCmdFull)
    If StrLen(szCmdFull) = 0 Then ExitProgram(-1)
   
    Select Case szCmd1
        Case "-clip"
            fp = FileOpen(file, APPEND)
            FilePrint(fp, szCmdFull)
            FilePrint(fp, sepa)
            ClipboardSetText(szCmdFull)
            FileClose(fp)
        Case "-timestamp"
            'March 12, 2006 - 19:35:27 PM
            fp = FileOpen(file, APPEND)
            FilePrint(fp, GetMonth(Time(6)) & " " & Time(7) & ", " & Time(5) & " - " & _
            Time(1) & ":" & Time(2) & ":" & Time(3) & " " & Time(4))
            FilePrint(fp, szCmdFull)
            FilePrint(fp, sepa)
            FileClose(fp)
        Case "-top"
            fp = FileOpen(file, BINARY_INPUT)
            szTemp = FileGet(fp, FileLen(file))
            FileClose(fp)
            fp = FileOpen(file, OUTPUT)
            FilePrint(fp, szCmdFull)
            FilePrint(fp, sepa)
            FilePrint(fp, szTemp)
            FileClose(fp)
    End Select
End If

Function  $GetMonth(ByVal  %iMonth)
    Select Case iMonth
        Case 1
            Return "January"
        Case 2
            Return "February"
        Case 3
            Return "March"
        Case 4
            Return "April"
        Case 5
            Return "May"
        Case 6
            Return "June"
        Case 7
            Return "July"
        Case 8
            Return "August"
        Case 9
            Return "September"
        Case 10
            Return "October"
        Case 11
            Return "November"
        Case 12
            Return "December"
    End Select
End Function

So mouser?
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Farr's ADDNOTE
« Reply #1 on: March 12, 2006, 10:52 PM »
let me try it and report.. i think this will make a kickass addon for FARR.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Farr's ADDNOTE
« Reply #2 on: March 12, 2006, 11:02 PM »
working great so far (no pun intended).

in fact this is something that i think is so useful that im going to make a video demo movie of the latest farr and show it being used along with calc.

i have 3 requests though if possible:
1) make it parse all commandline arguments (ie until no more args starting with -); that way we can do addnote -top -clip blah blah
2) the first argument should be filename (or make it work like -file "filenamegoeshere"); this is very important, since people need to be able to specify custom files and where they should go.
3) the use of _ for newlines is not good; can we use the standard \n please?


Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Re: Farr's ADDNOTE
« Reply #3 on: March 13, 2006, 04:23 AM »
Hi mouser,

Yes, all is possible in FBSL!

1) To get Commandlines ytou can use this :

For i = 0 to CommandCount()
  szCmd = Command(i)
Next i

And then you can parse each one starting with wanted keywords and so on...

2) no problem, you have to document it :)

3) just do this mod :
instead of :
szCmdFull = Replace(szCmdFull, "_", CRLF)

type this :
szCmdFull = Replace(szCmdFull, "\n", CRLF)

But, actually i'm at office... so i have to work before playing, but you can add these mods yourself ;)
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)

kfitting

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 593
    • View Profile
    • Donate to Member
Re: Farr's ADDNOTE
« Reply #4 on: March 13, 2006, 05:38 AM »
Maybe I missed something... what does "AddNote" do?

Kevin

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Farr's ADDNOTE
« Reply #5 on: March 13, 2006, 05:55 AM »
it'll be clearer when i make the demo movie, but basically,
it lets you keep a text file of quick notes, and add a note by bringing up farr and typing like:
addnote remember to buy red wine

that would add a timestamped entry in a plain text file with that text.

you could add aliases for different files, etc. like you could add
idea paint the room green
to have it add a (timestamped) note to a specific todo.txt file

and of course you could add other aliases to open the files, etc.

so basically its just a really quick and dirty way to use farr to help you keep note files.


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Farr's ADDNOTE
« Reply #6 on: September 11, 2006, 02:17 AM »
sorry to revive an ancient topic.. ;)
but is there a compiled version of this tool? i couldn't find it in the forums.. btw, why not link to AddNote from F+rr itself, that way it'll be easier to find..