Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
Appletiser •->


Anmeldedatum: 11.10.2001 Beiträge: 8
|
Verfasst am: 11.10.2001 - 01:38 Titel: AppleSkript&GraphicConverter - Skriptanpassung |
|
|
Hallo hier im Forum
Ich habe ein bitte.
Ich selber bin nicht so bewandert in AppleSkript. Ich habe aber folgendes vor.
Es gibt auf der Homepage von GraphicConverter einige Beispielskripte. Eines ist zum konvertieren von PICT-Datein in JPEG-Dateien.
Nun hätte ich gerne dass das Skript aber auch GIFs,BMPs, etc. in JPEG umwandelt.
In einem anderen Forum war schon jemand so nett und hat das vorhandene Skript so erweitert, dass das mit den GIFs und BMPs schon funkltioniert.
Aber, wenn ich versuche ein sogennantes Clipping-Format (Clip-Datei>Drag&Drop aus Word) zu konvertieren funktioniert es nicht.
An dieser Stelle poste ich also mal das Skript:
-------------------------------------------------------------------------
property destFldr : ""
on run
set inFiles to (choose file with prompt "Choose a PICT file:" of type {"PICT", "BMP ", "GIFf", "Clipping", "IMG"}) as list
open (inFiles)
end run
on open (inFiles)
try
--try
-- this requires the "Jon's Commands" scripting addition to work
-- if it's not present, you won't be able to set the destination
-- folder by pressing Option, but the script will still work
--if (´event JonsgKeyª) contains "Option" then
--set destFldr to ""
--end if
--end try
if destFldr = "" then
set destFldr to (choose folder with prompt "Choose a destination folder:") as text
end if
set the text item delimiters of AppleScript to {"."}
tell application "Finder"
repeat with aFile in inFiles
if kind of aFile is not "Folder" then
set derType to file type of aFile
if derType is "PICT" or derType is "BMP " or derType is "GIFf" or derType is "Clipping" or derType is "IMG" then --hier kann man noch mehr bekannte FileTypen einfügen.
set theFile to (aFile as string)
set theName to the name of file aFile
set theName to (text item 1 of theName) & ".jpg"
tell me to convertIt(theFile, theName)
end if
end if
end repeat
end tell
--(tell application "GraphicConverter" to quit)
set the text item delimiters of AppleScript to {""}
on error errMsg number errNbr
doError(errMsg, errNbr)
end try
end open
on convertIt(theFile, theName)
try
tell application "GraphicConverter"
activate
open {alias theFile}
save window 1 in (destFldr & theName) as JPEG
close window 1
end tell
on error errMsg number errNbr
doError(errMsg, errNbr)
end try
end convertIt
on doError(errMsg, errNbr)
set the text item delimiters of AppleScript to {""}
display dialog "GraphicConverter has encountered an error" & return & errMsg & return & "Error number: " & errNbr ¨
buttons {"OK"} default button 1 with icon stop
end doError
-----------------------------------------------------------------------------------------------
Ja, was soll ich dazu noch sagen, es wäre total super, wenn mir noch jemand weiterhelfen würde.
Ich weiss nicht aber vielleicht ist es auch irgendwie möglich, die Clips erst vorher in ein GIF Format zu konvertieren und erst dann das bereits vorhandene Skript zu starten. Ich brauch das ganze jedenfalls für ca. 500 Clips.
Erstmal vielen Dank, für die evtl. Hilfe. _________________ Herzliche Gr¸þe, Andreas |
|
Nach oben |
|
 |
Folker •---->


Anmeldedatum: 11.12.2000 Beiträge: 649 Wohnort: Holsteinische Schweiz
|
Verfasst am: 11.10.2001 - 08:26 Titel: AppleSkript&GraphicConverter |
|
|
Hallo Andreas,
ja, von mir kam nur der Tipp wg. ScriptMyMac
Habe, ohne das gesamte Script zu analysieren, auf die Schnelle getestet. Es funzt wenn man denne die richtigen "Typen" angibt, d.h. für norm. Graphik-Clips (habe kein Word!?) ist das "clpp". Das muß 2x in dem Script gewechselt werden - und schon läuft's. Allerdings ist das mit dem 2x schon ein bißchen viel - die Typen sollten als Properties fest "verdrahtet" werden.
property the_types: {"PICT", "clpp", Ö}
Dann kann man sehr handlich mit dieser "Eigenschaft" des Scripts arbeiten.
choose file Ö Ö of type (my the_types) Ö
bzw. if derType is in (my the_types) then
Änderungen der Typenliste müssen nur 1x vorgenommen werden, es kann nix vergessen werden.
Achso, parameter "of type" bei choose file ist auf max. 4 begrenzt. Sollte diese Beschränkung unter OSX nicht mehr existieren, so werden die Kollegen hier das schon noch posten.
Was die Typen angeht, hier ein kleines Script zum Testen der jeweiligen Dateitypen. Einfach als Application (NOT stay open) gespeichert.
Ist eines meiner ältesten Scripte auf der Platte, tut noch heute seinen Dienst, darum NIE überarbeitet worden (ich glaub, das würd ich heute a bisserl anders machen )
Gruß,
Folker
--=============
script nina
on ProcessAFile(fileList)
repeat with bFile in fileList
set TVar1 to info for bFile
if folder of TVar1 then
set TVar2 to "Ordner: \"" & name of TVar1 & "\""
else
set TVar2 to "Creator: \"" & file creator of TVar1 & "\"; Typ: \"" & file type of TVar1 & "\""
end if
display dialog TVar2 buttons {"Abbruch", "Danke"} default button 2 with icon -16557
if button returned of the result is "Abbruch" then exit repeat
end repeat
end ProcessAFile
end script
on open of fileList
tell nina to ProcessAFile(fileList)
end open
on run
set theFile to choose file
tell nina to ProcessAFile({theFile})
end run
--==================== _________________ Gruß,
Folker Brandt
=============================
Systemberatung · Datenbanken · Webdesign |
|
Nach oben |
|
 |
Appletiser •->


Anmeldedatum: 11.10.2001 Beiträge: 8
|
Verfasst am: 11.10.2001 - 16:53 Titel: AppleSkript&GraphicConverter |
|
|
Hallo Folker,
manchmal ist es so einfach.
Danke, Danke ,Danke.
Ich hatte die Sache mit den "Clipping" selber eingetragen, weil ich im Skriptverzeichnis von GraphicConverter unter dem Punkt Save nur diesen Formatnamen gefunden hatte.
Nochmals schönen Gruß und Danke,
Andreas _________________ Herzliche Gr¸þe, Andreas |
|
Nach oben |
|
 |
|
|
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen.
|
Powered by phpBB © 2001, 2002 phpBB Group Deutsche Übersetzung von phpBB.de
|
|
|