| View previous topic :: View next topic |
| Author |
Message |
JoeSchmoe as guest Guest
|
|
| Back to top |
|
 |
haichen
Joined: 05 Feb 2007 Posts: 110 Location: Osnabrück, Germany
|
Posted: Fri Jul 11, 2008 2:31 pm Post subject: Added Isense to PSPad |
|
|
You can add your own Vb- Perl- or JS-scripts to the PSPad menu scripts.
The following Vb-script adds an Isense menu to PSPad and starts Isense automatically if a AHK-script is startet with PSPad.
AHK.vbs
| Code: | ' it will start Script-library
const module_name = "all my AHKscripts for PSPad" '
const module_ver = "11.07.2008" 'version
sub startIsense
Set objShell = CreateObject("WScript.Shell")
' change the path
objShell.CurrentDirectory = "c:\programme\PsPad\AHKforPSPad\Isense"
objShell.Run "ISense.ahk"
end sub
Private Function GetFileName()
On Error Resume Next
Set editor = newEditor()
editor.assignActiveEditor
GetFileName = editor.fileName
End Function
sub RunIsenseIfAHK
Set editor = NewEditor()
Set tmpeditor = NewEditor()
tmpeditor.assignActiveEditor
tmpFileName = tmpeditor.fileName
AHKexist = 0
For i = 0 To editorsCount - 1
editor.assignEditorByIndex(i)
editor.activate
Set FS = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("Shell.Application")
Set File = FS.GetFile(GetFileName())
Ext = FS.GetExtensionName(file)
if ext = "ahk" and AHKexist = 0 then
AHKexist = 1
startisense
editor.assignEditorByName(tmpFileName)
editor.activate
Exit for
End If
next
end sub
' name "Init" is required, its called automatically during initialization to create menu items
sub Init
' comment RunIsenseIfAHK if you dont want autostart of Isense
RunIsenseIfAHK
addMenuItem "start Isense","Autohotkey", "startIsense"
' add more AHK menuitems
end sub |
Of course you must change the path to Isense.
Then you've to put the script in \PSPad\Script\VBScript
You can recompilate the scripts ( you find it below menu scripts) or just restart PSPad.
If you don't want automatic start of Isense you can comment RunIsenseIfAHK in Sub Init.
Maybe this is useful for some.
Thanks for ISense 
Last edited by haichen on Fri Jul 11, 2008 3:43 pm; edited 1 time in total |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Fri Jul 11, 2008 3:17 pm Post subject: |
|
|
| Quote: | | you've to change all relative Paths in all Isense files to %a_scriptdir%\.... |
Or better, don't change IS but change your VB script so it sets correct working directory before starting ISense.
That way you don't have to change ISense each time we post new version. _________________
 |
|
| Back to top |
|
 |
haichen
Joined: 05 Feb 2007 Posts: 110 Location: Osnabrück, Germany
|
Posted: Fri Jul 11, 2008 3:48 pm Post subject: changing working dir |
|
|
Thanks, I added setting working directory in the above post.
Now it works without changing your code. |
|
| Back to top |
|
 |
daniel2
Joined: 23 Jul 2007 Posts: 41
|
Posted: Fri Jul 11, 2008 11:48 pm Post subject: |
|
|
| Thanks for updating this! Having functions available makes this so much more useful! |
|
| Back to top |
|
 |
J_P Guest
|
Posted: Sat Jul 12, 2008 4:06 pm Post subject: |
|
|
| JoeSchmoe as guest wrote: | | Hi, J_P, I'm not a big fan of .rar either, |
Thanks,
I guess majkinetor was having a bad day. |
|
| Back to top |
|
 |
dyuhas
Joined: 31 Dec 2007 Posts: 6
|
Posted: Mon Jul 14, 2008 4:44 am Post subject: Can't run Isense |
|
|
I'm new to autohotkey.
Whenever I try to run isense.ahk I get the error: #Include file "includes\Setup_GUI.ahk" cannot be opened. setup_gui.ahk is located in the same dir as isense.ahk.
I read the readme.txt. There are no instructions that I can find on what file to execute to start the script or where to install it.
How do I run isense? |
|
| Back to top |
|
 |
freakkk
Joined: 29 Jul 2005 Posts: 130
|
Posted: Mon Jul 14, 2008 4:55 am Post subject: Re: Can't run Isense |
|
|
| dyuhas wrote: | | ..setup_gui.ahk is located in the same dir as isense.ahk | Well- that file should actually be in the 'includes' folder. Not quite sure how it got dumped into the same folder as isense.ahk, but you may want to retry extracting from the .rar, or possibly evan re-download .rar _________________ .o0[ corey ]0o. |
|
| Back to top |
|
 |
J_P Guest
|
Posted: Mon Jul 14, 2008 3:23 pm Post subject: |
|
|
| the rar file seems to be all wrong .... |
|
| Back to top |
|
 |
dyuhas
Joined: 31 Dec 2007 Posts: 6
|
Posted: Mon Jul 14, 2008 8:11 pm Post subject: Re: Can't run Isense |
|
|
| freakkk wrote: | | dyuhas wrote: | | ..setup_gui.ahk is located in the same dir as isense.ahk | Well- that file should actually be in the 'includes' folder. Not quite sure how it got dumped into the same folder as isense.ahk, but you may want to retry extracting from the .rar, or possibly evan re-download .rar |
No "includes" sub-folder and a re-download produces the same result.
Now what? |
|
| Back to top |
|
 |
freakkk
Joined: 29 Jul 2005 Posts: 130
|
Posted: Tue Jul 15, 2008 3:29 am Post subject: Re: Can't run Isense |
|
|
| dyuhas wrote: | | re-download produces the same result |
That is strange. Not sure why it isn't working for you; I just downloaded .rar again, and everything extracted fine for me.
Regaurdless, I repackaged again, & hopefully this time it will work.
There is now a .zip & .rar version availiable.
>> Download <<
| dyuhas wrote: | | There are no instructions that I can find on what file to execute to start the script or where to install it. |
After you extract ISense to its own folder (anywhere you please..), you just run the ISense.ahk.
Requires Autohotkey 1.0.47.06+ _________________ .o0[ corey ]0o.
Last edited by freakkk on Wed Jul 16, 2008 3:37 am; edited 1 time in total |
|
| Back to top |
|
 |
J_P Guest
|
Posted: Tue Jul 15, 2008 3:46 pm Post subject: |
|
|
thanks for the zip file - definitely different than the previous rar file.
However, can't seem to get version 153 working....
I noticed zip file didn't include folder for editors, has this been dropped ? |
|
| Back to top |
|
 |
freakkk as guest Guest
|
Posted: Tue Jul 15, 2008 4:27 pm Post subject: |
|
|
Please elaborate on how it's not working for you, and what editor your using.
This version auto-detects the editor your currently using, and adjusts the method based on that. This would be the reason for editor folder to not exist now. |
|
| Back to top |
|
 |
HugoV
Joined: 27 May 2007 Posts: 499
|
Posted: Tue Jul 15, 2008 4:27 pm Post subject: |
|
|
| J_P wrote: | | I noticed zip file didn't include folder for editors, has this been dropped ? |
From the post announcing 153:
Methods are now automatic. Isense automaticaly chooses method based on the editor you run atm (freakkk) |
|
| Back to top |
|
 |
J_P Guest
|
Posted: Tue Jul 15, 2008 5:13 pm Post subject: |
|
|
| freakkk as guest wrote: | Please elaborate on how it's not working for you, and what editor your using.
This version auto-detects the editor your currently using, and adjusts the method based on that. This would be the reason for editor folder to not exist now. |
I'm using textpad, I start to type in a word, and nothing happens, I hit control space and i see the code tries to read the first three characters but then nothing else happens. |
|
| Back to top |
|
 |
|