Jump to content

Recommended Posts

Posted (edited)

I've made for me an script to save current file in SciTE with setting an time stamp inside this. It looks so:

#Region - TimeStamp
; 2011-04-21 14:17:49
#EndRegion

I've used Jos' function "SendSciTE_Command" and it works fine. But using commands to set property (i.e.: "property:SelectionstartLine=" & $line) takes no effect.

So i've solved by using "Send()" :unsure: - but i'm not happy with this.

Does anyone know, whats wrong by my attempt to set property ?

Here the script:

  Reveal hidden contents

Edited by BugFix

Best Regards BugFix  

  • Developers
Posted (edited)

try:

If $sSelection[0] <> "#Region " & "- TimeStamp" Then
    ; no '#Region  - TimeStamp' in File, so write it at line 1
    ; if someting is selected in line 1, it will moved after stamp
    SendSciTE_Command($My_Hwnd, $Scite_hwnd, "insert:" & _
                    "#Region " & "- TimeStamp\n" & _
                    "; " & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & "\n" & _
                    "#EndRegion\n\n" & $sSelection[0])
Else ; '#Region  - TimeStamp' always exists
    SendSciTE_Command($My_Hwnd, $Scite_hwnd, "askproperty:SelectionstartLine")
    $iLine = StringRegExp($sReceive, '(?::\d+:macro:stringinfo:)(\d+)', 1) ; get the line where it was found
    If @error Then Exit
    SendSciTE_Command($My_Hwnd, $Scite_hwnd, "goto:" & $iLine[0]+1 & ",1")
    SendSciTE_Command($My_Hwnd, $Scite_hwnd, "extender:dostring editor:LineDelete()")    
    SendSciTE_Command($My_Hwnd, $Scite_hwnd, "insert:" & _
                    "; " & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & "\n")

EndIf

enjoy,

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Thanks Jos . u're the one. :unsure:

But where can i found more information about this? (like using "extender" and so on)

Is it also in the Scintilla documentation? I've not found something like this before.

Best Regards BugFix  

  • Developers
Posted

  On 4/22/2011 at 9:25 AM, 'BugFix said:

Thanks Jos . u're the one. :unsure:

But where can i found more information about this? (like using "extender" and so on)

Is it also in the Scintilla documentation? I've not found something like this before.

I have looked for that as well but never found anything substantial. most of what I know is the "Search, trial and Error" method. :>

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • 3 years later...
Posted (edited)

How do i set a property for current session?

This is how i have been tried:

;First attempt
SendSciTE_Command("extender:dostring props['find.replace.regexp']='1'")

;Second...
SendSciTE_Command("property:find.replace.regexp=1")

But no effect, i want to set RegExp for search dialog.

Any ideas?

Edited by MrCreatoR

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...