Your best friend for file transfer.

Fetch application logoFetch

Preferred Encoding - Contextual Menu (5 posts)

  • Started 13 years ago by Randy
  • Latest reply 13 years ago from Randy
  • Randy Member

    I work with files that are mostly Latin1 but often GB18030.

    It would be quite nice to be able to option click those GB files and be able to choose GB18030 from a menu called 'Open Using Encoding'. (Prefs let you select which to display, just as with BBedit.)

    Posted 13 years ago #

  • Jim Matthews Administrator

    Hi Randy,

    Thanks for that suggestion, we'll think about that. In the meantime, I think you could use an AppleScript to switch the preference to GB18030, edit the file, and then switch the preference back.

    Here is an AppleScript to try. You would paste it into Script Editor, and then save it. If you have a Script menu in your menu bar, you can add the script to that menu by putting it in the Scripts folder inside the Library folder of your home folder. If you don't have a Scripts menu you can Google for instructions on adding it, or just add the script to your Dock and run it that way.

    The script:

    tell application "Fetch"
    set savedEncoding to preferred encoding
    set preferred encoding to GB18030

    set selectedItems to selection
    if (count of selectedItems) is 0 then
    display dialog "Please select a file to edit using the GB18030 encoding"
    else
    repeat with aFile in selectedItems
    edit aFile
    end repeat
    end if

    set preferred encoding to savedEncoding
    end tell

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 13 years ago #

  • Randy Member

    (Possible to have a scripts icon in the Fetch window?)

    Posted 13 years ago #

  • Jim Matthews Administrator

    Not currently, no, but I'll take that as a request for such a feature.

    Thanks,

    Jim Matthews
    Fetch Softworks

    Posted 13 years ago #

  • Randy Member

    (I request all requests be implemented.) lol...

    Posted 13 years ago #

Reply

  • Or nickname, if you prefer.
  • This will be kept confidential.
  • This is to ensure that you’re a person, not a spambot.