Und wie baue ich mir meine Linkliste?

Ich ziehe mir ja alles von Interesse immer auf den Schreibtisch... der wird immer voller dadurch, kein Wunder. Jetzt kann ich zumindest die ganzen Weblocs regelmäßig löschen und mir einfach eine Liste daraus bauen, nach etwas hilfe von hier:
Code zum markieren einmal anklicken Code im Skript-Editor öffnen

set weblocs_in_folder to every paragraph of (do shell script "ls " & (quoted form of POSIX path of (choose folder) & "*.webloc"))

set myurls to {}

set url_texts to {}

repeat with current_webloc in weblocs_in_folder

set myurls to myurls & geturlfromwebloc(current_webloc)

set url_texts to url_texts & ((characters 1 through (-1 * (count of ".webloc") - 1) of (do shell script "basename " & quoted form of current_webloc)) as text)

end repeat

set htmltext to "<ul>"

repeat with i from 1 to count of myurls

set htmltext to htmltext & "<li><a href=\"" & item i of myurls & "\" target=\"_blank\" rel=\"nofollow external\">" & item i of url_texts & "</a></li>"

end repeat

set htmltext to htmltext & "</ul>" as text

set the clipboard to htmltext

on geturlfromwebloc(weblocpath)

set weblocpath to quoted form of ((POSIX path of weblocpath) & "/rsrc")

set cmd to "strings " & weblocpath & " | grep http | sed '/^.http/s//http/' | head -1"

set cmd to cmd as «class utf8»

set weblocurl to do shell script cmd

return weblocurl

end geturlfromwebloc

This entry was posted in AppleScript and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


three + 6 =

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...