dicas

Dicas de Snippets para TextExpander

Seguem algumas idéias de uso para o TextExpander, um app campeão no Mac. Ainda que esteja presente na Mac App Store, ele foi descontinuado por lá. Melhor comprar por fora.

  •  Assinatura de email
  • Telefones
  • Endereços
  • Nomes
  • Domínios, gmail.com me.com
  • Sites mais acessados(favoritos)
  • Código HTML
  • Ortografia, voo(e suas variantes) para vôo, iphone para iPhone, …
  • Caracteres especiais,  ♥ ≠ ≥ ™ ª º ½
  • Formatação de texto

E você? Para que mais usa o TextExpander? Registre nos comentários.

Uma dica extra. Coloque esse código num snippet:


set my_Login to "cocatech"
set my_API_Key to "R_1541c4872b534c095befc7a24ab9a1b5"

set the ClipURL to (the clipboard as string)

ignoring case
if ((characters 1 through 4 of ClipURL as string) is not "http") then
return "Malformed URL."
else
set the EncodedClipURL to urlencode(ClipURL) of me
set curlCMD to ¬
"curl --stderr /dev/null \"http://api.bit.ly/v3/shorten?format=txt&login=" & my_Login & "&apiKey=" & my_API_Key & "&uri=" & EncodedClipURL & "\""

-- Run the script and get the result:
set tinyURL to (do shell script curlCMD)

return tinyURL
end if
end ignoring

on urlencode(theText)
set theTextEnc to ""
repeat with eachChar in characters of theText
set useChar to eachChar
set eachCharNum to ASCII number of eachChar
if eachCharNum = 32 then
set useChar to "+"
else if (eachCharNum ≠ 42) and (eachCharNum ≠ 95) and (eachCharNum < 45 or eachCharNum > 46) and (eachCharNum < 48 or eachCharNum > 57) and (eachCharNum < 65 or eachCharNum > 90) and (eachCharNum < 97 or eachCharNum > 122) then
set firstDig to round (eachCharNum / 16) rounding down
set secondDig to eachCharNum mod 16
if firstDig > 9 then
set aNum to firstDig + 55
set firstDig to ASCII character aNum
end if
if secondDig > 9 then
set aNum to secondDig + 55
set secondDig to ASCII character aNum
end if
set numHex to ("%" & (firstDig as string) & (secondDig as string)) as string
set useChar to numHex
end if
set theTextEnc to theTextEnc & useChar as string
end repeat
return theTextEnc
end urlencode

Defina o Conteúdo como AppleScript.

Agora, copiem para a área de transferênia uma URL, por exemplo https://cocatech.com.br

Acionem o snippet criado com o código acima. O que aconteceu, hein?

🙂

Gustavo Faria

de um tempo em que a UFRJ formava não cientistas da computação, mas bacharéis em informática e acompanhe as Dicas do Coca.
Botão Voltar ao topo