~CODE UNIT~

EXPECT US
 
HomeFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Coding Tutorial

View previous topic View next topic Go down 
AuthorMessage
Lotus

avatar

Posts : 14
Join date : 2015-12-26

PostSubject: Coding Tutorial   Sat Dec 26, 2015 10:14 pm

How to code:
-- Align selected cells across selection
-- Copyright under GPL by Mark Grimes
-- Saving with '\sca' in the filename creates Shortcut: Crtl+Shift+a

tell application "Microsoft Excel"
   --activate
   tell range (get address selection) of active sheet
       if (get count columns) > 1 or (get count rows) > 1 then
           if (get horizontal alignment) is horizontal align center across selection then
               set horizontal alignment to horizontal align general
           else
               set horizontal alignment to horizontal align center across selection
           end if
       else
           if (get horizontal alignment) is horizontal align center then
               set horizontal alignment to horizontal align general
           else
               set horizontal alignment to horizontal align center
           end if
       end if
   end tell
end tell



This really is just leveraging the Padre code. At this point I actually use Padre::PPI but that has the downside of requiring Wx (which I personally like but it is quite a requirement). I only added a bit of code to make this into its own package and included some hints on vim scripting. The idea is to show how this could be abstracted into a standalone module then Padre, vim and any other reasonably powerful editor could use it. For now, I have packaged it as App::LexVarReplace with App::LexVarReplace::Vim pod. I would appreciate suggestions on the package layout and name, and any feedback from the Padre guys would be great. The git repository is available for your perusal. I must say that Padre seems very cool. I continue to check it out every once in a while, but I just can’t seem to give up vim, gnu screen and a good old xterm. The developers have really done a great job leveraging modern Perl tools. You should check it out! I am only publishing this on github for now. I would like to speak with tsee or one of the Padre developers before this makes it debut on CPAN, but I’m a bit short on time at the moment.
Back to top Go down
View user profile
Lotus

avatar

Posts : 14
Join date : 2015-12-26

PostSubject: Re: Coding Tutorial   Sat Dec 26, 2015 10:16 pm

Note: This only works with windows 10. Have fun Very Happy
Back to top Go down
View user profile
CodeRIP

avatar

Posts : 7
Join date : 2015-12-26

PostSubject: Re: Coding Tutorial   Sat Dec 26, 2015 10:19 pm



W̵̑͋͋ͮ̔̊͑e̪̞̺̅̎̽͂’͆ͥ̆̾ͩr͓̺̘͗e̙̥̘̱͎̽͟ ͇̳̣͓̾n̶͙͆͛̉̈o̢̫̹̅̄͗̏̎ͥͣ ͪͮͥ̑ș̲̪͌̇͊ͪ̂̌́t̲̰͚̞̟̞̞͜r̺̭͙̖ȧ̴̲̫̑ͫ͊ͭͬn... ͕̰̙̬̟̩̻ṯ̷͖ͥó̥̯͌̅̃ͧ͂́ͅ ̴̗̃̿ͫ̈́́̐l̡͂̾ȏ̜͓͇͙̈ͨ̋̑v̅͑͟e̝̙̭͚̝̾͌͞ͅ.ͭ͛͗...
ͪ̀͏̹̠̠͕̳Y̗͔͙̼͊͜ỏ̂̈ͦ̈͘u̯͈̬̬͕̙ͨ̍ͧͥͩ͊͂ ̵k͆̄ͪn̳̣ͥͬͫ͋ͨ̾o̦͔̙ͫ̓ͣ̄̑̏w̷̫̠ ̵͓ͤ͋͒t̗̹͓̝̠̲̿ͤͧͨ̆ḧ̠͚̹̥͍̘̙ͫ̚̕e̶̤͖͍̫͎͔͓̾ ̼͊̇̿r̜̦̬̠̘̽̅̊̿ͅŭ͎̲͙̊͂̔l̩̳̙̞̦̽͌ͨ͆̅̂͞e̙̟̩... ̴͙̱͇ͩ̄ͬ̉ͅa̯̩̅ͭ̀̾̿n̥͈͉̗̳̎́ͬ̒͜d̨͈͉̖̐̔ͨ̌ͦͯ͋... ̗̖̰̞̤͙͉̐ͭ̍ͤs̡͈͕̖̹ͥ̍ͤ́̉o̴̪͇̣͓̘̦̳͆̉̽ͣ̾ ̯͇̱̜̺͖͆ͩ̉̈̚d̬͚̰̻͙̹̓̎̓̈́o̡̭̯̙͇̭͂̎ ̰͇̗I̴̭̣̜̥̫̞̠̒̓̆̊̉.̭̅ͩ͊
͚͔͙͔́̅̚A͌̑ͯͧ̽҉͕̦̙ ̶̮͎͍̟f͍͈̤̘͖̪̬u̺̙̥̲̬͌ͧ̔̆l̨̫̬̯̪̥͚̄̌͊l̎ͥͭ̔̊... ̸̤͕̂͋̂ͨ͋c̠̙̻o̺͍͈͔̥͍̝͒ͫͫ̇͗ͯ̇͢m̝̳̙̪̦ͫ̌̀̌́ͅ... ̺̀ͮ̆̊͑̔̃ͅw̧̜͇͒̉͌h͎̝̗͙͓̤̔ͭ̈́̅͗̀̚á͍t͒̊ͫ͏͚ ̦̮̭̮̦̱̼ͦ͡Ḭ̘̣̯̱̜̊̆̃́̄ͅ’̼̼̫m̛̃̀ ̥ͪ̇̇̈̐̈́̈t̨ͫ̚ḧ͇́͛͑ͨ̽͋i̿͌҉͙̩̪n͈̈́͐͞k̢ͯͧͤ̀î... ̬͚͉̖̗ͦ͂̉̈́ͨ͡ͅò̷̫̝̘̌ͧ̓̍f̥͉͚͙̤̝̆̈͠ͅ.́̀ͨ̽̅ͨ...
̠͇̫͓̖̻̼͑Y̐o̪̦̬͓͖u̼̝͉̯͋ ̶͎̳̝̤̘w͍̝̳ͅo̗̗̩͔̿͊ͨ̏̂̃uͭ̊͊̔ͬl̥̯̦̠͑̔ͪͥ̄̊̚... ̷͖̳̱̚g̭͉̣͍̯̳ͅe̡̝̤͇͔͓͔ͫͫ̊̄t̵̻̗̩̖̼̄̿ ̪ͤ͌ͩ̃t͈͉̫ͣͫ͆ͭͨͅḩ͉̥͖͎͓ͨ͋ͥ͋ͤͅī̴̼̪͇̝̫͙͈̑s... ̣͈̩͈̣̺͓ͨ͊̊̀f̦̙̰̈ͪr̖̘̝̜͓ͮ̆͒o͖̮̜̜̜̎̆̿̄́m͛ͤ... ̶͇̻͕͍͓ͭ̒͗ͅa̝̥̼̗̘̩ͮ̈͂͟n̡̜͎̓͛ͫ̌̚y̫͓͂̂ͮͬͫͬ͋ ̊̀̂̉ȍ̫͈͓͈̊̉͋̿̾t̴̾̒͒̐ͣ̄͐ḥ̠͗͌e͑͒̾͏̫̥̼̖̳r... ̸̠̳͍̙͂ͥg̱͉̬ȕ̸͙͈̇̉̏̅͂͒y̷̬̹̰̼̮.̮͚̥̪̻ͤͭ̇̄ͧ
̬͈͈͒I̭̮̤͒́ͦ̋͞ ̯̬̘̣̺ͥ̂͐͐ͣ͆͂j̵̲̰͌͂̏̉u̸̲s̬͍̥̝̕ͅt͕̼̅̐͒̆ͤͥ̀... ̩̞̰͙͖̏̆͛w̫͐̐̒̍̏̂̍a̜̪͂̏̎̾̌ͪͩn̤͈̳̜͚t̀̃̊ͤ̑̀... ̧͍̝͓̼̜̝ͬ̆ͫ͛̿t̛͉̩̣͔̻o͓̯̜̗͛̓̊͗͂ ̾͗̊̃ͥţ̱̖͐̋͌ͯ̏͌̚e̜͓͙̼̠̎l̙̘̙̫̲ͣ̂̀͂̀͞l̈́͆́ͩ... ̳̘̰̜̟̹̒y̶͕͆ͮ̔̽o̞̬͉͂ͭų̙̯̦̯͚͂̓̊ ͖͇̞̪̙̭ͦͨͭ̉̒̔̏͠h̷̞͗͌ͭͪ̆͒ọ͉̝̭͙͂̍̀w̗̜̩̣̓̅ͅ... ͓̩͚͎̰̒̎̓ͩ̎I̦̲̰͍̟ͮ̓̆̆̓ͅͅ’̴̰͈̗͚͐͆̿ͣͬm̈̇̐̊̀... ̨̓ͥf͈̮͍̣͙ͩͦ̃͆ͅe̛̤͂ͦ͂e̹͉͕̻͌ͨ̀l̥̖̈́i̡͊̎ͭ̈́͂͐...
͉͈͈̥ͩͦ̎́G̬̝̘͚̞̈́ͭͦͩ͛o̠̯̫̐̈̄͑ͯ̾͐̕t̖ͬ̒́͒̓... ͖̪̣̇̋m̹̔ͦ̄aͭͯ͛ͩͨ́k̖̱̥̝̰̝̓͝ĕ͎͈̪͈̞͖ͪ̐̚͠ ̶ͯ̓̚yͪͧͪ̎̂̕o̒ͨͥ͏u̡̜̼̟ͯ ̲͔̲̭͈̐͋̅͐̉́́u͂̾̈́͌n̩̲̜̣̫̔̍͆͝d̾̂́̿̉͞e̩̙̭̓̈...
͓̄ͬ͑ͅÑ͇̺͉̦e͉ͣ̅ͪͪ̚v̛̼ͭͯͤ͒͋eͦ͗ͥ̋ͯ̊̉͏rͤͥ... ̯̹̬̦͈͉̌̉͑̽ͣ̑g̣̩̓͆̉̓ͅo͈̟̦͖̳͚̒̽ͦ̂n̶͎͇̤̳͗͆̏... ͖̱̈́̉̋͆̍͊g̣͔̦ͧͫͯͤͯͧ̚i̦͈͕̙̞̠͎͆̕v̵̻̳̜͔̠̮̉̅́... ̋ͨ̿ͪ̅͏̳̰͈͍͚y̻͓̋͒̃͊̊̉ͦo̰͙̦̣̟̥̟ͫͬ̓͆ͥ́u̶͖̮̬... ͏̘͕͙̦̙͔ụͣ̔p͇̯͓̭̘̺̎̐̍͌̒ͯ̈́ͅ.͉̪̩̈́͂
̲͇̭͔̖ͮ̀̄ͬͪ͐̃N̼͞e̳͎͇̭͎ͩ͒̏̀̾ͣ̕v̯̦͇̦eͨ̔̏̚... ̩̖̠̖̌ͧ͆̂g҉o̵̟͇̘͕ͧ̅ͭ̆n̒̅na͇͚̹ͤ͑͢ ͎͈̻͂ͫ́ͩl̵̙͎̤̠̦̿e͉̩̙͖̤̼ͥͤͤ̓ͫ͢ͅt̜͉̹ͬ̔ͥ̓ͦ̂̐... ͙̉ẙ̡̭͓̥͙̀̿̄̿ͨ̌ͅǒͮͭ͊̊͂͂ǔ͙͛̋̋ ̐̍̇͏͚͉̩̰̬̱̻d̢̬̲̱̘̿̃̈́ͅö̘̝͙͓̭́ͤ͐͑̃̓w̡ͭ̔̆ͨ̏...
͍̟̜̱ͩ̂̐͢N̤͓̼̭̞ͬ̏̒̅ͮ̕ͅe͐͌̈ͩ҉͈͚v̝̎̀͒͑͛̉̚... ̅҉̬̩̘̭̼g̛͉̩̪̦̯͈̈ͩo͓͖̖̞̹n͌ͩ̓̽ṇ̨͚̄a̰͔̲͋͡ ̪̪͈͓̇͑̎̀r̼̖̹̮̬ͮ̈́̐̅ͩu͚̻̘ͨ͑ͤͤ̉͑̄ͅnͯ͑͆͠ ̭̙ͫ̆̐̀ͅa̡̳͑̀ͭr̫̤͖̫͂o̻̠̳͎̼ͮ̅ͯ̚u̸̮̗̰̘ͣ̏̾̚n... ̺̝̭̼̤̭̎̃̊̆a̲͑̔̇͗̅̈́ͥn̩̳̺̞̯̒̾ͬ͞ͅdͨ͐͆͌̒͊͜ d͍̜̞̲͓͍͔̎̓͛̓̚e̱͕̖͉̮ͫͨ̌͋͜s̷͓̲̻ͭͅë͈̳͇́͒̈͊̕... ̳̔̉̊̎̉̐y̲̺͕ͯò͙͕ͭ͌͘ủ̥̐ͮ̽ͧ.͓̲̈́̓
̸͇͚͍̭̊̌̈̂̍͂ͮṊ̛͕ę̦̝͔v̛ͧè͈ͯ͊͐́ͮ͌rͭ̾̓ͦ... ͈g̣̉ͨo̷͍̬̤̗͉ͧͣͦ̀ͩn̽ͮͫ͛n̞̻̟̹ͮa̳̍̑̎ ̼̯͈ͥ̉̽̔ͦ̚m̴̮̠ͬ̎ͣ̀ͬ͆̆à͇̗̜̗̲̍ͦ͊k̓̉ͨ̇̔ͣ҉̳̤... ͍͖̫̫̗̓y͔͛ͤ̒̽͌͂̕o̹͓̠̦u͚͍͍͓͎̤̼̎̈ͭ̄͒̓ ̸̺̇ͤc͂͊ͨͦͭͮr̢̥̘̖̩̻̟̂ͬ͊y̭̮̥̰ͦͩͮ͋̐̚ͅͅ.͊̄͛ͬ
ͪ̀̓ͤN̴̬͖͍̲̹̘͐̽̋͋͑̈́ͅê͙͍̰͕̦͔ͫ̊̋̀ͯv̗̽͗̓e... ̓g͍̭̥ò̽͏̺̭ń̹̩̞͍͕͖n̟̣̟̏ä̶̹̌͌͒ ̵̙̲̔̅̆s̼̰̩̹͖̟̐̀ͅa͇͍̥̤̲͇ͬ͂͐͌̚ŷ̷̦̱͕͉ͥ̽͗̚ ̶͉͓̭̫̯̙̆͊ͫg̫̮̜ͯͮ̅͆ͬơ̳̈͛̎̀ͨoͥ́҉͔̮̻̠̭̫̳d́...
͕͓͓͗N̦̣͉ͮ͟e̥̼̯͇͈ͅv̐̅͌̈̈̑̚͢ḙ̷͎̥̭̹ͭͪͨ̾r... ̓ͨ̌͂͋͐͛g̢̭͙̝̖ͨͮ́͌͌o̯̖͌́n̾̄̿̿͌̊͏̼͖̮͖͍̙n͖̐... ̛̞̠͈͈̙͍̂̓̆tͦ̋̍͛ͯ̓̚e͕̟̘̟̺ͩ̌l̇̈̌͋l̶̠͓̲ͬ̈́̽̑... ̫̤ͫͬ̀ͧ͛͡a̟̫̣̠̘̰̰̾̀̊͟ ̴̙̗̹̿͆͋ͨl̗̥̫͑̌i̤̺̰̘͎̿͋ͦe͓̭ͤ̉͑ ͖̺̫̠̳͍̪̿̋ǎ̆҉͎̳n̪̳̺̰ͪ̋ͅd̖̰̣͍̱̦̦͊͋͑̿͐̀̚ ͈̺̭̩͖̗̼́̈͊h̺̭̱̥̤̦́̍ͭͧ̃̌̂͢uͤ̌͗͋͏̦̳͖̘̠͍̰rͮ... ̙̠̋͞ÿ͙̲̘̟͉̺̠́ō̮̣̝̳̤̫̳̚̚uͤ̿̓̐͛͗̚.̹̬͊ͨ̃̐͠...
͙̝͔̯͎̍Ẅ̠̼̰͇̄̇͆̒͡ė̻’͓̹̱̌͒͞ṿ̝̩̜̦͉͑̊͘e... ̳̱ͣ̉ͮͥk̹̯ńo̥̺̞͎̍̄ͩ́̿̚͞w̡͇̗̫ͨ͐̅͋́̚n̉ͪ́̆͐... ͈̙̘̹ͤ̾ͪͭ̈́̋͐e̴͕̮ǎ̹͊ͮ̓͂͆́c̲̝͇̗ͪ̃̀͝ḫ̑̅̎͛ͮ... ̜̳̯̋̅͛̔ͅo͙̳̙͇͗̑t̠͇̙̥̔ͭ̌ͭͤ̿h̠̥̗ͫ̐̍̆e̟̾r͛ͨ... ͖̫̭̤͑ͪ͋ͮͪͦf̷̤͉̠͈͍̖̅ͥ̽͗ͦo͔͙̫̠r̴̫̝̩̙͔ͬ ̝͇̖̈́͛̈ͧ̾̒s̛̝̺̤͍ͥ͌̋ͅͅo̩͙̓́̔̅ ̭̖̹͇͓̺̏̚ĺ͍̣̝͚̦̺̼ͤ̽͟o͙̙͆̽̇̂̎͐̍ͅn̫̼͊͒͢g̈̏...
Back to top Go down
View user profile
CodeM

avatar

Posts : 14
Join date : 2014-06-14
Location : CodeUnit

PostSubject: Re: Coding Tutorial   Tue Dec 29, 2015 4:43 am

Df
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Coding Tutorial   

Back to top Go down
 
Coding Tutorial
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
~CODE UNIT~ :: Your first category :: General Discussion-
Jump to: