- AuthorPosts
- November 28, 2007 at 12:49 pm #5061haibinproMember
in emeditor text,
when I click
http://www.techsupportalert.com/firefox.htm
it will auto run opera to open the site.
is’t possible that click
d:try123.txt
and then auto open the 123.txt by default programme.November 28, 2007 at 1:47 pm #5062xxx_picMemberuse a marco to do it!
#language = "VBScript"
'############################################################
'* Name: Open This File V1.0 For EmEditor Pro v6 Marco
'* Date: 2007-11-28
'############################################################
On Error Resume Next
sText = document.selection.Text
If Len(sText)=0 Then
'Check if is ASP's INCLUDE FILE
xPos = document.selection.GetActivePointX(eePosLogical)
yPos = document.selection.GetActivePointY(eePosLogical)
document.selection.SelectLine
sText = document.selection.Text
Set regEx = New RegExp
regEx.Pattern = "<!--s*#INCLUDEs*FILEs*=s*""(.+)""s*-->"
regEx.IgnoreCase = True
If regEx.Test(sText) Then sText=regEx.Replace(sText,"$1")
sText=Replace(sText,vbCrLf,"")
sText=Replace(sText,vbCr,"")
sText=Replace(sText,vbLf,"")
document.selection.SetActivePoint eePosLogical, xPos, yPos
Set fso = CreateObject("Scripting.FileSystemObject")
fPath = Left(document.FullName,InstrRev(document.FullName,""))
sText = fPath & Replace(sText,"/","")
If fso.FileExists(sText) Then editor.OpenFile sText,0,eeOpenAllowNewWindow
Set fso=Nothing
Set regEx=Nothing
Else
'Check if is local hard disk address (C:abc1.txt) or network address (abc1.txt)
Set fso = CreateObject("Scripting.FileSystemObject")
Set regEx = New RegExp
regEx.Pattern = "^(?:[A-Z]:|\)[^s]"
regEx.IgnoreCase = True
If regEx.Test(sText) Then
'absolute address
If fso.FileExists(sText) Then editor.OpenFile sText,0,eeOpenAllowNewWindow
Else
'relative address
fPath = Left(document.FullName,InstrRev(document.FullName,""))
sText = fPath & Replace(sText,"/","")
If fso.FileExists(sText) Then editor.OpenFile sText,0,eeOpenAllowNewWindow
End If
Set fso=Nothing
Set regEx=Nothing
End If
November 28, 2007 at 2:47 pm #5063haibinproMemberI choose i:1.txt and run macro,and it works well.
but when i choose i:1SpxImagexy1.jpg and run macro,it return some wrong.First Pop a windows:
EmEditorNull characters (00H) contained in the file will be replaced with spaces.
i:1SpxImagexy1.jpg
after comfirm it,
pop a second windows:EmEditor
Some characters cannot be converted using the specified encoding. The file will be corrupted if you continue editing and save the file.
i:1SpxImagexy1.jpg
after comfirm it,
emeditor open it and show the file in txt mode,but not image mode(though with a iranview logo on the tab)November 29, 2007 at 12:41 am #5064haibinproMemberI try to use file:// to make the request possible,
and it works,for example:
file://g:pfyblksblk.txt
file://e:Downloadsflashgetlist.pngbut when the route content some unicode character(some chinese character for example),emeditor cann’t figuer out the character and so when I use
file://Chenhaibin文件222103.jpg
and when I click at it,windows will open exploere to open the folder Chenhaibin,but not open the file 22103.jpgNovember 29, 2007 at 1:00 am #5065Yutaka EmuraKeymasterhaibinpro wrote:
I try to use file:// to make the request possible,
and it works,for example:
file://g:pfyblksblk.txt
file://e:Downloadsflashgetlist.pngbut when the route content some unicode character(some chinese character for example),emeditor cann’t figuer out the character and so when I use
file://Chenhaibin文件222103.jpg
and when I click at it,windows will open exploere to open the folder Chenhaibin,but not open the file 22103.jpgDid you check “Recognize Double-Byte characters as URLs” in the Link tab of the Configuration Properties?
November 29, 2007 at 3:06 am #5066haibinproMemberAfter check “Recognize Double-Byte characters as URLs” in the Link tab of the Configuration Properties.
It works,Thanks. - AuthorPosts
- You must be logged in to reply to this topic.