| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen   | 
	 
	
	
		| Autor | 
		Nachricht | 
	 
	
		mikelchris •->
  
 
  Anmeldedatum: 10.03.2004 Beiträge: 7
 
  | 
		
			
				 Verfasst am: 12.10.2004 - 10:27    Titel: Already Existing-Files umbenennen? | 
				     | 
			 
			
				
  | 
			 
			
				Hallo,
 
 
ich habe ein Problem mit meiner FolderAction.
 
 
Sobald sich beim drucken ein PDF mit gleichem Namen im Ordner "Printed" befindet, möchte ich das neue PDF umbenennen, wie z.B. "test.pdf1",  "test.pdf2", "test.pdf3"....
 
 
Wie kann ich mein Script ändern um dieses Problem zu lösen.
 
 
Vielen Dank für eure Hilfe!
 
 
 	  | Code: | 	 		  property done_foldername : "Printed"
 
 
on adding folder items to this_folder after receiving added_items
 
   tell application "Finder"
 
      if not (exists folder done_foldername of this_folder) then
 
         make new folder at this_folder with properties {name:done_foldername}
 
      end if
 
      set the target_folder to folder done_foldername of this_folder
 
   end tell
 
   
 
   repeat with thisFile in added_items
 
      tell application "Finder"
 
         set fileName to name of thisFile
 
         if fileName ends with ".pdf" then
 
            set the target_file to (move thisFile to the target_folder) as alias
 
            
 
            tell application "Acrobat 5.0"
 
               open thisFile
 
               print pages front document with shrink to fit
 
               close front document
 
            end tell
 
         end if
 
      end tell
 
   end repeat
 
end adding folder items to | 	 
  | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		herkules •-->
  
 
  Anmeldedatum: 05.01.2004 Beiträge: 23 Wohnort: wädenswil - schweiz
  | 
		
			
				 Verfasst am: 16.11.2004 - 11:31    Titel:  | 
				     | 
			 
			
				
  | 
			 
			
				hi!
 
die folgende kleine anpassung sollte eigentlich funktionieren
 
 
property done_foldername : "Printed"
 
 
on adding folder items to this_folder after receiving added_items
 
	tell application "Finder"
 
		if not (exists folder done_foldername of this_folder) then
 
			make new folder at this_folder with properties {name:done_foldername}
 
		end if
 
		set the target_folder to folder done_foldername of this_folder
 
	end tell
 
	
 
	repeat with thisFile in added_items
 
		tell application "Finder"
 
			set fileName to name of thisFile
 
			if fileName ends with ".pdf" then
 
				
 
				if |FileExists|(thisFile, false) then
 
					set fileName to (fileName & (length of (list folder target_folder without invisibles)) + 1) as string
 
				end if
 
				
 
				set the target_file to (move thisFile to the target_folder) as alias
 
				
 
				tell application "Acrobat_5.0.5"
 
					open thisFile
 
					print pages front document with shrink to fit
 
					close front document
 
				end tell
 
			end if
 
		end tell
 
	end repeat
 
end adding folder items to
 
 
-- File-Existenz pruefen
 
--**********************
 
on |FileExists|(Input, Del)
 
	
 
	-- Flag setzen
 
	set Output to false
 
	
 
	-- Input konvertieren
 
	set Input to Input as string
 
	
 
	-- pruefen
 
	tell application "Finder"
 
		
 
		-- existent?
 
		if exists file Input then
 
			
 
			-- Flag setzen
 
			set Output to true
 
			
 
			-- loeschen, wenn gewuenscht
 
			if Del then
 
				delete file Input
 
			end if
 
		end if
 
		
 
	end tell
 
	
 
	-- Wert zurueckgeben
 
	return Output
 
	
 
end |FileExists| _________________ gruss   christos;-) | 
			 
		  | 
	 
	
		| 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 
		 | 
	 
 
 | 
 
 |