Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5061
    haibinpro
    Member

    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.

    #5062
    xxx_pic
    Member

    use 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

    #5063
    haibinpro
    Member

    I 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:
    EmEditor

    Null 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)

    #5064
    haibinpro
    Member

    I try to use file:// to make the request possible,
    and it works,for example:
    file://g:pfyblksblk.txt
    file://e:Downloadsflashgetlist.png

    but 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.jpg

    #5065
    Yutaka Emura
    Keymaster

    haibinpro wrote:
    I try to use file:// to make the request possible,
    and it works,for example:
    file://g:pfyblksblk.txt
    file://e:Downloadsflashgetlist.png

    but 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.jpg

    Did you check “Recognize Double-Byte characters as URLs” in the Link tab of the Configuration Properties?

    #5066
    haibinpro
    Member

    After check “Recognize Double-Byte characters as URLs” in the Link tab of the Configuration Properties.
    It works,Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.