2018-06-10 02:54:11

Hi guys

I've started with Python, and I need an accessible editor to write my code on the Mac. I know if I coded with Linux I can use Vim just fine. How about the Mac? Could you recommend something? I used Textmate and it isn't good at all.


Thumbs up

2018-06-10 06:29:25

TextMate is accessible. Did you find something specific you ran into that wasn't?
There always is textedit. Xcode is also accessible, but that is probably a bit to heavy for just a glorified text editor. You could still use vim or emax and if VoiceOver and the terminal are giving you issues install TDSR.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2018-06-10 15:12:33

Yes, Textmate was accessible, but it doesn't tell the indentations that you have maid. For example, if I were to code my code with Vim on Linux, Orca would counts the number when I press space. So I don't get confuse as a Python Nubie.

Thumbs up

2018-06-10 21:34:23

No editor will give you the capability of doing that. That is on the screenreader. VoiceOver can do this but you need to script it using keyboard commander and apple-script.
Save this file or copy the code below if the link doesn't work.

    Speak indentation level of current line
    Version: 1.0
    Description: This script tell, using VoiceOver's functions, the indentation     level of last phrase tould by VoiceOver.
    Known bugs:
        (1): if you use this function twice you will get a wrong result.

Copyright 2012 Tyflos Accessible Software. All rights reserved.
You may incorporate this Tyflos Accessible Software sample code into your system and     program(s) without restriction.  
This sample code has been provided "AS IS" and the responsibility for its operation is yours.  
You are not permitted to redistribute this Tyflos Accessible Software sample code as "Tyflos     Accessible Software sample code" after having made changes.  If you're going to redistribute the code, we require that you make it clear that the code was         descended from Tyflos Accessible Software sample code, but that you've made changes.

If you have any suggestion or petition about this software please send an e-Mail to Tyflos Accessible Software using this e-Mail address:
    [email protected]


on isVoiceOverRunningWithAppleScript()
    set isRunning to true
    -- is AppleScript enabled on VoiceOver --
    tell application "VoiceOver"
            set x to bounds of vo cursor
        on error
            set isRunning to false
        end try
    end tell
    return isRunning
end isVoiceOverRunningWithAppleScript

on getCurrentIndentationLevel()
    tell application "VoiceOver"
        set textLine to content of last phrase
        set textLenth to count of (textLine as string)
        set currentPosition to 1
        set currentCharacter to text item 1 of textLine
        set indentationLevel to 0
        repeat while currentCharacter = " " -- change this line if you want a tab char for indentation
            set currentPosition to (currentPosition + 1)
            set indentationLevel to (indentationLevel + 1)
            set currentCharacter to text item currentPosition of textLine
            if currentPosition ≥ textLenth then
                exit repeat
            end if
        end repeat
        set resultado to indentationLevel
    end tell
    return resultado
end getCurrentIndentationLevel

-- start of script --
if isVoiceOverRunningWithAppleScript() then
    set indentationLevelResult to getCurrentIndentationLevel()
    tell application "VoiceOver"
        output indentationLevelResult
    end tell
    say "This function is not supported. Please active script suport for VoiceOver in VoiceOver settings dialog."
end if

Place the file in "/Library/Scripts/VoiceOver/" or where ever you store your applescripts for keyboard commander.

Make sure in the general tab of VoiceOver commander you check the checkbox that says allow voiceover to be controlled with applescripts. Then go into the commanders tab and set up a key combo to activate the applescript you just added.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2018-06-11 15:05:59

Kyleman, thanks for the file. That's helps a lot.

Thumbs up