Jump to content


Photo

FSC - Forum Script Copier [BoBo]


  • Please log in to reply
11 replies to this topic

Poll: Download Barometer (1 member(s) have cast votes)

Download Barometer

  1. That's BoBolicous ! (1 votes [100.00%])

    Percentage of vote: 100.00%

  2. Nice, but ... (OK - I'll post it - once I've understood the meaning of this poll!) (0 votes [0.00%])

    Percentage of vote: 0.00%

  3. Before I'd copy this, I'd marry Britney Spears! (0 votes [0.00%])

    Percentage of vote: 0.00%

  4. Well, you didn't steal the majority of the code. Fair enough. (0 votes [0.00%])

    Percentage of vote: 0.00%

  5. OMG! You must be really, really bored ... (0 votes [0.00%])

    Percentage of vote: 0.00%

  6. UselessToolnameAlert (0 votes [0.00%])

    Percentage of vote: 0.00%

Vote Guests cannot vote

#1 Beastmaster

Beastmaster
  • Members
  • 191 posts

Posted 02 September 2008 - 04:54 PM

/*
     
      AutoHotkey Version: 1.0.47.06
      Language:           English
      Platform:           WIN_XP
      Author:             BoBo/tank


      Script Function:    Create a script based on a copy from the AutoHotkey-Forum.
      Handling:           Pressing the ALT-key while left-clicking a Forum-posts (mini) icon ...
                          will detect its assigned PostID. If you'll copy a posts script (within 30 seconds time, ...
                          using the forums 'script copy' function, a local copy of the script will be created.
                         
                          For reference reasons the created file contains the PostID and a timestamp within its filename.
                          Additionaly the PostID (its origin path) and an advise regarding an added Hotkey is given in the header section of the created file.
                          The added hotkey (ALT+W) should give direct access to the origin post at the forum.
                          That might make sense if you wanna respond after testing.
                         
*/


#NoEnv                                                            ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input                                                    ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%                                       ; Ensures a consistent starting directory.
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, DetectCopyActivity, 500
SetTimer, DetectCopyActivity, Off

!LButton::
    MouseGetPos,,, hwnd
    WinGetTitle,title, ahk_id %hwnd%
    MsgBox,% title   
    StatusBarGetText, PostURI, 1, ahk_id %hwnd%                   ; get the posts ID
    SoundBeep                                                   
    If InStr(PostURI,"http://de.autoHotkey.com")                  ; identify if working at the US/UK or the German AHK-forum
      Msg := "Code wurde in Zwischenablage kopiert."
    If InStr(PostURI,"http://www.autoHotkey.com")
      Msg := "Code copied to clipboard."
    ClipBoard =
    SetTimer, DetectCopyActivity, On
    Return

DetectCopyActivity:
    NonActivityCount++
    IfWinExist, Internet Explorer, %Msg%
    {
      Sleep, 200
      ControlSend, Button1, a, Internet Explorer, %Msg%
      Sleep, 200
      ControlSend, Button1, {ENTER}, Internet Explorer, %Msg%
      SplitPath, PostURI,,, POSTID                                 ; extract PostID from PostURI
      StringSplit, PostID, PostURI,#
     
      FileName := "AHKForumPost_" PostID2 "_" A_Now ".ahk"         ; set the output name, here: AHKForumPost_<origin number of the post>_<timestamp>.ahk
      FileAppend,
      (LTrim
      ;
      ; This script was copied from here: %PostURI%
      ; A hotkey (ALT+W) to easily connect directly to that post is added at the bottom of this file.
      ;
     
      %ClipBoard%
       
      !w::Run, "%PostURI%",, Max
      )
      , %A_ScriptDir%\%FileName%                                    ; create the file
     
      Run, Edit %FileName%, %A_ScriptDir%, OutputVarPID             ; run the file
      SetTimer, DetectCopyActivity, Off
      NonActivityCount = 0
      Return
      }
    If NonActivityCount = 60
    {
      SoundBeep
      ToolTip, Wait period expired! Bye.
      Sleep, 2500
      ToolTip
      POSTURI =
      SetTimer, DetectCopyActivity, Off
      }
    Return

!s::Run, "%A_AhkPath%" "%A_ScriptDir%\%FileName%",,, OutputVarPID   ; ALT+S start the copied/created script
!x::Process, Close, %OutputVarPID%                                  ; ALT+X exit the (created and afterwards) executed script
Hope that makes sense to you. 8)
If you can' t stand such a noobish attempt, feel free to impress us with a RegEx-, DllCall()-, HttpQuery()-, <your magic command here>-release.

Have fun. 8)

06/09/2008: script has been edited for [that] reason. Thx tank :D

[BoBoPromo]
To promote your AHK-DIY-GUIs at the forum ...
To support your favourite noob with an image instead of confusing rocket science statements ...
Why not draw a picture? Or even better use
[FSB] ? :lol:
[/BoBoPromo]

Keywords: Forum - BoBo - BoBo² - test - test script - script reference - BB Code - phpBB

#2 Guests

  • Guests

Posted 02 September 2008 - 05:51 PM

What mini icon? =P

#3 BoBo²

BoBo²
  • Guests

Posted 02 September 2008 - 05:53 PM

@ to noobs it may concern
once you copied the above script, and created a valid ahk file from it, you can use it that way ...

Posted Image

1..2..3.. Ladies & gentlemen .. start the script!!

a) position your mouse over the tiny little 'document' icon which you can see at the header section of a post (indeed the one in the red circle)
B) now press ALT + LButtoon (that's your left mouse button) together. You should hear a beep. (otherwise your speakers are off, broken, or your surname is Beethoven).
c) now click the Copy 'button' above the scripts window (yes, the one in the blue circle). Boom --- a confirmation pop up box appears and, - will get closed.

If the copied script will open instantly within your local editor, congrats you made it! If not ... YOU ARE TO SLOW! :shock:

The copy event has to be done within 30 seconds after you 'ALT+LButton'-clicked the posts icon.

Noobs unite! 8)

#4 trik

trik
  • Members
  • 1317 posts

Posted 02 September 2008 - 09:29 PM

It's nice to see ol' BoBo back with a simple but useful script. :lol:

#5 BoBo²

BoBo²
  • Guests

Posted 02 September 2008 - 09:44 PM

Thx. TBH, it was tougher not to post all my useless scripts :lol:

#6 thepitster

thepitster
  • Members
  • 4 posts

Posted 06 September 2008 - 06:32 PM

is this by some chance vista compatible if not then i get nothing with i follow the instructions, i hear beeps and im clicking the right areas

#7 tank

tank
  • Members
  • 4105 posts

Posted 06 September 2008 - 09:22 PM

BoBo
while i could have went for a COM approach it was easier to fix the file as such
/*
     
      AutoHotkey Version: 1.0.47.06
      Language:           English
      Platform:           WIN_XP
      Author:             BoBo

      Script Function:    Create a script based on a copy from the AutoHotkey-Forum.
      Handling:           Pressing the ALT-key while left-clicking a Forum-posts (mini) icon ...
                          will detect its assigned PostID. If you'll copy a posts script (within 30 seconds time, ...
                          using the forums 'script copy' function, a local copy of the script will be created.
                         
                          For reference reasons the created file contains the PostID and a timestamp within its filename.
                          Additionaly the PostID (its origin path) and an advise regarding an added Hotkey is given in the header section of the created file.
                          The added hotkey (ALT+W) should give direct access to the origin post at the forum.
                          That might make sense if you wanna respond after testing.
                         
*/


#NoEnv                                                            ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input                                                    ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%                                       ; Ensures a consistent starting directory.
#SingleInstance, Force
SetTitleMatchMode, 2
SetTimer, DetectCopyActivity, 500
SetTimer, DetectCopyActivity, Off

!LButton::
    MouseGetPos,,, hwnd
    WinGetTitle,title, ahk_id %hwnd%
    StatusBarGetText, PostURI, 1,ahk_id %hwnd%                   ; get the posts ID
    SoundBeep                                                   
    If InStr(PostURI,"http://de.autoHotkey.com")                  ; identify if working at the US/UK or the German AHK-forum
      Msg := "Code wurde in Zwischenablage kopiert."
    If InStr(PostURI,"http://www.autoHotkey.com")
      Msg := "Code copied to clipboard."
      msg1:="Do you want to allow this webpage to access your Clipboard?"
 ClipBoard =
    SetTimer, DetectCopyActivity, On
    Return

DetectCopyActivity:
    NonActivityCount++
    
    IfWinExist, Internet Explorer, %Msg% 
    { 
      
      IfWinExist,Internet Explorer,%msg1%
      {
        SendInput,!a
        ControlSend, Button2, {ENTER}, Internet Explorer, %Msg% 
        WinWaitClose, Internet Explorer,%msg1%     
      }
      Sleep, 200 
      ControlSend, Button1, {ENTER}, Internet Explorer, %Msg% 
      WinWaitClose, Internet Explorer, %Msg% 
      SplitPath, PostURI,,, POSTID                                 ; extract PostID from PostURI
      StringSplit, PostID, PostURI,#
     
      FileName := "AHKForumPost_" PostID2 "_" A_Now ".ahk"         ; set the output name, here: AHKForumPost_<origin number of the post>_<timestamp>.ahk
      FileAppend,
      (LTrim
      ;
      ; This script was copied from here: %PostURI%
      ; A hotkey (ALT+W) to easily connect directly to that post is added at the bottom of this file.
      ;
     
      %ClipBoard%
       
      !w::Run, "%PostURI%",, Max
      )
      , %A_ScriptDir%\%FileName%                                    ; create the file
     
      Run, Edit %FileName%, %A_ScriptDir%, OutputVarPID             ; run the file
      SetTimer, DetectCopyActivity, Off
      NonActivityCount = 0
      Return
      }
    If NonActivityCount = 60
    {
      SoundBeep
      ToolTip, Wait period expired! Bye.
      Sleep, 2500
      ToolTip
      POSTURI =
      SetTimer, DetectCopyActivity, Off 
      }
    Return

!s::Run, "%A_AhkPath%" "%A_ScriptDir%\%FileName%",,, OutputVarPID   ; ALT+S start the copied/created script
!x::Process, Close, %OutputVarPID%                                  ; ALT+X exit the (created and afterwards) executed script
it will work in both ie6 and 7 which should solve the vista problem described earlier ie7 shows windows internet explorer not microsoft so i just toook out the microsoft and added a step to deal wtih the possible allow access prompt that comes
peice

#8 thepitster

thepitster
  • Members
  • 4 posts

Posted 06 September 2008 - 09:29 PM

now that did it thnx tank

#9 Guests

  • Guests

Posted 09 September 2008 - 11:39 PM

One Word WOW 8)

Always wanted too created some like this myself only I wanted a hotkey that created some temp.ahk and execute it imediatly from the clipboard.

:shock: Gosh want can I say your the greatest keep up the good work.

#10 awannaknow

awannaknow
  • Members
  • 369 posts

Posted 31 May 2010 - 04:26 PM

Just realized, when reading your post that I only have a code expand link in : Opera, firefox and chromium.
So I opened IE and there I have a copy link.

@ to noobs it may concern
once you copied the above script, and created a valid ahk file from it, you can use it that way ...

Posted Image

1..2..3.. Ladies & gentlemen .. start the script!!

a) position your mouse over the tiny little 'document' icon which you can see at the header section of a post (indeed the one in the red circle)
B) now press ALT + LButtoon (that's your left mouse button) together. You should hear a beep. (otherwise your speakers are off, broken, or your surname is Beethoven).
c) now click the Copy 'button' above the scripts window (yes, the one in the blue circle). Boom --- a confirmation pop up box appears and, - will get closed.

If the copied script will open instantly within your local editor, congrats you made it! If not ... YOU ARE TO SLOW! :shock:

The copy event has to be done within 30 seconds after you 'ALT+LButton'-clicked the posts icon.

Noobs unite! 8)



#11 sinkfaze

sinkfaze
  • Moderators
  • 6089 posts

Posted 31 May 2010 - 04:29 PM

That's because of the forum software issues detailed here.

#12 awannaknow

awannaknow
  • Members
  • 369 posts

Posted 31 May 2010 - 04:45 PM

Thanks sinkfaze
:wink:

That's because of the forum software issues detailed here.