Postado 10 de março de 201412 anos comment_836054 Fala galera! Não sabia onde postar isso no fórum, aí resolvi postar aqui mesmo. Pra quem gosta de personalizar o desktop, criei um mini script para pegar os últimos post do Macmagazine e deixar fixado no desktop. Estou usando o Geektools, que achei sem querer na net. Os posts são atualizados a cada 30min (da para personalizar o tempo de refresh, fonte e cor). Quem quiser é só pedir! Print do desktop, para mostrar como que fica:http://s29.postimg.org/y1b9c0rsn/Screen_Shot_2014_03_10_at_13_27_10.png Abraço!!! Editado 10 de março de 201412 anos por Lucas Maciel Denunciar
Postado 10 de março de 201412 anos Autor comment_836074 Detalhe: ainda estou começando com essa coisa de AppleScript. Esse código daí requer que o safari tenha pelo menos uma aba aberta! Amanhã vou dar uma reformulada no funcionamento. Se tiver alguém aqui que tenha a manha no assunto, sinta-se livre para fazer qualquer modificação!!! Denunciar
Postado 10 de março de 201412 anos Autor comment_836098 Desculpa aí, não colou da primeira vez. tell application "Safari" set URL of tab 1 of window 1 to "http://www.macmagazine.com.br/" delay 5 set myurl to get URL of tab 1 of window 1 set tab1text to get text of tab 1 of window 1 repeat until (offset of "Últimas Notícias" in tab1text) is 0 set the_offset to offset of "Últimas Notícias" in tab1text set tab1text to items (the_offset + 17) thru (count tab1text) of tab1text as string end repeat end tell set textoCompleto to "" repeat with i from 1 to 20 set tab2text to paragraph i of tab1text if length of tab2text is greater than 80 then if length of tab2text is not greater than 250 then set textoCompleto to textoCompleto & tab2text & linefeed & linefeed end if end if end repeat return textoCompleto Denunciar
Postado 10 de março de 201412 anos comment_836130 Achei interessante aquele controle de banda no canto superior direito... Como colocou ele ali? Denunciar
Postado 10 de março de 201412 anos Autor comment_836146 Achei interessante aquele controle de banda no canto superior direito... Como colocou ele ali? Outro Script: EN1 = Wireless EN0 = Cabo Ethernet INTERFACE=en1; SAMPLE_A=(`/usr/sbin/netstat -bI "$INTERFACE" | awk "/$INTERFACE/"'{print $7" "$10; exit}'`); sleep 1; SAMPLE_B=(`/usr/sbin/netstat -bI "$INTERFACE" | awk "/$INTERFACE/"'{print $7" "$10; exit}'`); BANDWIDTH_USAGE=(`echo "2k ${SAMPLE_B[0]} ${SAMPLE_A[0]} - 1024 / p" "${SAMPLE_B[1]} ${SAMPLE_A[1]} - 1024 / p" | dc`);echo "Download: ${BANDWIDTH_USAGE[0]} KBps \nUpload: ${BANDWIDTH_USAGE[1]} KBps"; Denunciar
Postado 10 de março de 201412 anos comment_836150 Outro Script: EN1 = Wireless EN0 = Cabo Ethernet INTERFACE=en1; SAMPLE_A=(`/usr/sbin/netstat -bI "$INTERFACE" | awk "/$INTERFACE/"'{print $7" "$10; exit}'`); sleep 1; SAMPLE_B=(`/usr/sbin/netstat -bI "$INTERFACE" | awk "/$INTERFACE/"'{print $7" "$10; exit}'`); BANDWIDTH_USAGE=(`echo "2k ${SAMPLE_B[0]} ${SAMPLE_A[0]} - 1024 / p" "${SAMPLE_B[1]} ${SAMPLE_A[1]} - 1024 / p" | dc`);echo "Download: ${BANDWIDTH_USAGE[0]} KBps \nUpload: ${BANDWIDTH_USAGE[1]} KBps"; Muito obrigado, vou testar o script. Denunciar
Postado 10 de março de 201412 anos Autor comment_836166 créditos para a turma do MacOSx Tips Denunciar
Postado 10 de março de 201412 anos comment_836510 Bem legal kra! Esse do mac magazine é rss? Denunciar
Postado 11 de março de 201412 anos Autor comment_836814 Consegui dar uma melhorada no código!!! Agora não precisa mais do safari estar aberto, e ele fecha a nova aba que ele abriu, para ler o site, automaticamente. Bem legal kra!Esse do mac magazine é rss? Não é não cara..... é buscando linha por linha o texto do site mesmo. Denunciar
Postado 12 de março de 201412 anos Autor comment_837746 Novo código, como prometido. tell application "Safari" if windows is {} then make new document with properties {URL:"http://www.macmagazine.com.br"} else set theURL to "http://www.macmagazine.com.br" tell window 1 to set current tab to make new tab with properties {URL:theURL} end if delay 3 -- qualquer problema, altere para 5 set closeTab to "MacMagazine" as string set tab1text to get text of current tab of window 1 repeat until (offset of "Últimas Notícias" in tab1text) is 0 set the_offset to offset of "Últimas Notícias" in tab1text set tab1text to items (the_offset + 17) thru (count tab1text) of tab1text as string end repeat close (every tab of window 1 whose name is equal to closeTab) end tell set textoCompleto to "" repeat with i from 1 to 20 set tab2text to paragraph i of tab1text if length of tab2text is greater than 40 then if length of tab2text is not greater than 250 then if tab2text does not contain "às" then set textoCompleto to textoCompleto & tab2text & linefeed & linefeed end if end if end if end repeat return textoCompleto Editado 12 de março de 201412 anos por Lucas Maciel Denunciar
Postado 12 de março de 201412 anos comment_837962 Parabéns pela iniciativa, muito bom mesmo! Denunciar
Participe do debate
Você pode postar agora e se registrar depois. Se você tem uma conta, entre agora para postar com ela.