.webloc vs .url -> Weburl Verweise

12/06/2010
Laut diesem Thread bei Stack Overflow kann man .webloc Dateien neben der Variante Drag&Drop auch von Hand schreiben und zwar im XML-Format seit Mac OS 10.3. Eine besonders kurze und wohl auch universellere Variante ist das .url Format:
Code zum markieren einmal anklicken

[InternetShortcut]

URL=http://www.apple.com/

 

Wichtig dabei ist dass, die Datei auf 3 Zeilen besteht, also die letzte leer ist.
1 Comment

Und wie baue ich mir meine Linkliste?

12/02/2010
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

No Comments