Gondwana
Hi

The challenge: My final goal is to have a tablet reading pdfs and websites, mark a interesting text and export everything including URLs to Thebrain with one shortkey. Later I can click a pdf link and go back exactely to the page of the pdf where I copied the text or reopen the website.

pdf pages can only be directly jumed to if the pdf link is a http URL. So the solution is to install a local web server...

The solution: (tested on xp, firefox 7.0.1, acrobat pro 7.0, Brain 7.0.0.8)

- Install and start xampp server, put all your pdf files in htdocs, set explorer to open pdfs with firefox, set firefox to open pdfs with acrobat) 
- Type about:config in addressbar of firefox. Search for browser.urlbar.trimURLs. Set to false
- Install autohotkey, paste the following code in a text file, open it in autohotkey.
Customize the two mouseClick positions to your need (use windowspy from autohotkey for it)
- Open a brain, choose a thought, you may choose the place in notes where import shall be placed.
- open a pdf from htdoc dir of xammp or a website in firefox (pdfs must be opened in firefox) select a text passage
- Press Ctr+g

; Export Browser URLs and selected text to TheBrain.
; Export optimised for Acrobat 7.0

^g::
IfWinExist ahk_class SunAwtFrame ;check ob brain offen
{
pdf = 0
clipboard =
Send ^c
Sleep 100
Text := clipboard ; Textselection abspeichern
clipboard =
MouseClick, left,  1221,  92, 1 ; **** Check with Windowspy of autohotkey the last possible place in the addressbar of your browser ****
Sleep, 100
Send ^c
Sleep, 100
Adresse := clipboard ; URL abspeichern
Sleep, 200
If Adresse contains file:///,localhost ;checken, ob es sich um ein pdf handelt
{
pdf = 1
clipboard =
MouseClick, left,  815,  1013, 1 ; **** check with windowspy of autohotkey your pagenr field in brwoser-pdf ****Seitenzahl (optimiert für Acrobat 7.0)
Sleep, 100
Send ^c
Sleep, 100
pages := clipboard
FoundPos := RegExMatch(pages, " ")
StringLeft, CurrentPage, pages, FoundPos
StringLeft, pdfCheck, Adresse, 1
Sleep, 100
if pdfCheck = f ; checken ob pdf von explorer kommt
{
StringRight, NeuAdress, Adresse, StrLen(Adresse)-24 ; You may change the value -24 when xammp is located in a other directory
pdfurl = http://localhost/%NeuAdress%
Adresse =
}
else
{
StringLeft, NeuAdress, Adresse, StrLen(Adresse)-7 ;wenn von localhost kommt, dann wird Seitenzahl aktualisiert
pdfurl = %NeuAdress%
Adresse =
}}
else
{
CurrentPage = ;wenn es eine Web URL ist
pdfurl =
pdf = 0
}
; now switch to brain
IfWinExist ahk_class SunAwtFrame ;check ob brain offen
{
WinActivate
sleep 100
Send ^k
sleep 300
if pdf = 1
{
SplitPath, pdfurl, name
SetKeyDelay, 30
Send {TAB 6}
Send ^a
sleep 100
Send %name%
Send {TAB 6}
SetKeyDelay, 10
Send ^a %pdfurl%{#}page=%CurrentPage% {enter}{Right}
Sleep 100
Send {enter}{enter}
Sleep 300
SetKeyDelay, 0
Send %Text%
}
else
{
SetKeyDelay, 10
sleep 200
Send %Adresse% {enter}{Right}
Sleep 300
Send {enter}{enter}
Sleep 300
SetKeyDelay, 0
Send %Text%
; BlockInput Off
}
SetKeyDelay, 500
Send {Right}
return
}}
else
{
MsgBox Please open a brain first.
;BlockInput Off
}
return

With Acrobat 10 you have to remove red marked lines with:

MouseClick, left,  213,  156, 1
Sleep, 100
Send ^c
Sleep, 100
CurrentPage := clipboard ; aktuelle Seitenzahl abspeichern


Now I only need the transformer 2 with windows 8....




Quote

Newsletter Signup  Newsletter Signup        Visit TheBrain Blog   Visit TheBrain Blog       Follow us on Twitter   Follow Us       Like Us on Facebook   Like Us         Circle Us on Google+  Circle Us         Watch Us on Youtube  Watch Us       

TheBrain Mind Map & Mindmapping Software     Download TheBrain Mind Mapping Software