Jump to content

lewislepton

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by lewislepton

  1. i have tried textexpander now. setup a few things. and i do quite like it. it does have some charm too it.

     

    i will still try and do something in alfred, just because. but for the time being i will stick to TE for what i need just now until i can get alfred to do my bidding

     

    see, the one thing that makes alfred perfect is that it pops up with a list of my functions when i type in, so i at least remember, you know. but oh well. it is what it is ;)

  2. cock balls.

    well i had a feeling it would be something like that since nobody had gotten back to me ;)

     

    but i have been looking at textexpander, think i just wanted to keep to alfred and not have a second application running. but oh well. what i am asking for is quite big. maybe ill get back on the alfred one one day in the future. but i need to just get work underway really ;)

    i more than likely will kepp on trying with alfred, because i love it so ;) so any ideas on this for further study would be amazing to look at.

     

    though on talking about this. other text editors would be fine wont they? guessing since the snippets thing does squash the mutiple arguments with sublime?

    because im actually just using sublime until a text editor i want to use gets its much needed update, which is peppermint editor. its lovely, and only for mac, much like alfred. ill have a test ;)

     

    thanks for your help. and if anyone else has any ideas then by all means please let me know ;)

     

    thanks again

     

    *EDIT*

    i did post that wouldnt use textexpander, but i will give it a go. may as well because it will still be easier right now ;)

  3. howdy all,

     

    this is just a quick question, but im working on using alfred as a text expander, which is working very well. but i will mainly be using it for coding. but one thing that happens in coding is that you change function names etc, and what im trying to do right now is work out how to make it even more special.

     

    now what i am thinking on is, is that i have a line of code, or even an entire keyboard function that is ready to go, but instead of the text being put in and then editing out what i need to change, i instead use alfred to put in arguments that change specific things in the text right away. ill post some code up to show exactly what i mean

     

    but just say i tap 'cmd-spacebar' to bring up alfred. i then type in something like '-keyboardmovement' and tap enter to put it in sublime text, it will put in this exact text

    function DEFAULT:key_down(key)
    	if key == string.byte('LEFT') then
    		DEFAULT-X = DEFAULT-X - DEFAULT-SPEED
    	elseif key == string.byte('RIGHT') then
    		DEFAULT-X = DEFAULT-X + DEFAULT-SPEED
    	end
    
    	if key == string.byte('UP') then
    		DEFAULT-Y = DEFAULT-Y + DEFAULT-SPEED
    	elseif key == string.byte('DOWN') then
    		DEFAULT-Y = DEFAULT-Y - DEFAULT-SPEED
    	end
    end

    now as you can see, i would now need to start editing everything that says 'DEFAULT', 'DEFAULT-X/Y' and 'DEFAULT-SPEED'. whilst its alright, it still means going back to edit.

    but, what i would like some sage like advice on, is how could i set arguments when first typing in '-keyboardmovement', that would then affect each 'DEFAULT' to my own liking.

     

    so when alfred is open, i type in '-keyboardmovement' then right after it asks for the first argument, which would be 'playerMove', the next argument would be for 'playerPosX', the next would be for 'playerPosY'... and so on.

    but then the output with my inputted arguments in alfred would then make the code look like this

    function playerMove:key_down(key)
    	if key == string.byte('LEFT') then
    		playerPosX = playerPosX - playerSpeed
    	elseif key == string.byte('RIGHT') then
    		playerPosX = playerPosX + playerSpeed
    	end
    
    	if key == string.byte('UP') then
    		playerPosY = playerPosY + playerSpeed
    	elseif key == string.byte('DOWN') then
    		playerPosY = playerPosY - playerSpeed
    	end
    end

    so, how could i work on something like that using alfred as the text expander?

    i know in sublime text when making cheap auto-complete in JSON, is that its has this type of way 'function(${1:first}, ${2:second})', but ive never used alfred to do this type of thing

    this will take me some time to make in the end. but id like to work on it as im going along in my coding, so i can put things in a take things out as im making stuff

     

    thanks to anyone who can point me in the right direction ;)

     

    best

×
×
  • Create New...