AutoHotkey Community

It is currently May 27th, 2012, 3:22 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 

Download Barometer
That's BoBolicous !
Nice, but ... (OK - I'll post it - once I've understood the meaning of this poll!)
Before I'd copy this, I'd marry Britney Spears!
Well, you didn't steal the majority of the code. Fair enough.
OMG! You must be really, really bored ...
UselessToolnameAlert
You may select 1 option

View results
Author Message
PostPosted: September 2nd, 2008, 5:54 pm 
Offline

Joined: April 23rd, 2007, 2:23 pm
Posts: 9
Code:
/*
     
      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


Last edited by BoBo on September 9th, 2008, 5:07 pm, edited 8 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2008, 6:51 pm 
What mini icon? =P


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2008, 6: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 ...

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)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2008, 10:29 pm 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
It's nice to see ol' BoBo back with a simple but useful script. :lol:

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2008, 10:44 pm 
Thx. TBH, it was tougher not to post all my useless scripts :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2008, 7:32 pm 
Offline

Joined: September 1st, 2008, 9:54 pm
Posts: 4
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2008, 10:22 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
BoBo
while i could have went for a COM approach it was easier to fix the file as such
Code:
/*
     
      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

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Last edited by tank on September 7th, 2008, 12:20 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2008, 10:29 pm 
Offline

Joined: September 1st, 2008, 9:54 pm
Posts: 4
now that did it thnx tank


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2008, 12:39 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2010, 5:26 pm 
Offline

Joined: June 14th, 2009, 7:48 pm
Posts: 331
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.
BoBo² wrote:
@ 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 ...

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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2010, 5:29 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
That's because of the forum software issues detailed here.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2010, 5:45 pm 
Offline

Joined: June 14th, 2009, 7:48 pm
Posts: 331
Thanks sinkfaze
:wink:
sinkfaze wrote:
That's because of the forum software issues detailed here.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Stigg, tidbit and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group