Ergebnis 1 bis 3 von 3
  1. #1
    Soul Monkey
    Inaktiv

    Spotlight Kommentare auslesen und ein Zeichen ersetzen

    Hallo, ich braeuchte ein AppleScript das die aktuelle Auswahl im Finder abfraegt und dann nach der Reihe die Dateien durchgeht, deren Spotlight Kommentar abfraegt und dann ein Zeichen "&" durch "|" ersetzt (derzeit sehen die Spotlight Kommentare einer Datei so aus "&tag1 &tag2 &tag3 &tag4") und den Kommentar wieder schreibt.

    Ein solches Skript konnte ich nicht finden und selbst bekomme ich das nicht hin. Ein Skript das die Moeglichkeit bietet neue Spotlight Kommentare hinzuzufuegen bzw. die alten mit den neuen zu ueberschreiben gibt es zum Beispiel hier.
    http://bbs.applescript.net/viewtopic.php?id=14199

    Bisher habe ich

    Code:
    tell application "Finder"
    	repeat with i in (get selection)
    		--set comment of i to ""
    		--hier fehlt der mittelteil
    	end repeat
    end tell
    bei tausenden von Dateien dauert die manuelle Bearbeitung bzw. loeschen und neu zuweisen laaaaaange.

    Danke

  2. #2
    Neuer Berner Rosenapfel
    Registriert
    12.2005
    Ort
    ☰⠀☲⠀☵⠀☷
    Beiträge
    1.948
    Hi Soul Monkey!

    Habe mich auf Grund deines Posts mal mit AppleScript's text item delimiters befasst und mich etwas eingefriemelt…



    Code:
    tell application "Finder"
    	activate
    	set sel to selection
    	repeat with i from 1 to count of items of sel
    		set thisFile to (item i of sel)
    		repeat with thisFile in sel
    			tell thisFile
    				set spotText to comment as text
    			end tell
    		end repeat
    	end repeat
    end tell
    
    
    
    
    set findThis to "&"
    set replaceWith to "|"
    
    set newText to switchSign of spotText from findThis to replaceWith
    
    
    tell application "Finder"
    	repeat with i from 1 to count of items of sel
    		set thisFile to (item i of sel)
    		set comment of thisFile to newText
    	end repeat
    end tell
    
    to switchSign of theText from SearchString to ReplaceString
    	set OldDelims to AppleScript's AppleScript's text item delimiters
    	set AppleScript's AppleScript's text item delimiters to SearchString
    	set newText to text items of theText
    	set AppleScript's AppleScript's text item delimiters to ReplaceString
    	set newText to newText as text
    	set AppleScript's AppleScript's text item delimiters to OldDelims
    	return newText
    end switchSign
    Gruss

  3. #3
    Soul Monkey
    Inaktiv
    Hallo space!

    Vielen Dank fuer das Script, funktioniert wunderbar, da kann ich gleich wieder aufhoeren das manuell zu machen.

    Gruss, Soul Monkey

Ähnliche Themen

  1. iweb und Kommentare
    Von Heidy im Forum Andere Software
    Antworten: 15
    Letzter Beitrag: 07.02.2010, 18:15
  2. iPhoto unsichtbare Kommentare? Kommentare löschen
    Von hyperion im Forum Photosoftware
    Antworten: 0
    Letzter Beitrag: 21.09.2006, 22:08
  3. Spotlight Kommentare
    Von thknop im Forum OS X
    Antworten: 1
    Letzter Beitrag: 25.10.2005, 18:44

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •