Hallo,
ich habe folgendes Problem.
Ich habe dieses AppleScript aus dem Internet:
-- Text abfragen
set theText to text returned of (display dialog "Bitte Text eingeben:" default answer "" with title "Texteingabe in Datei speichern" with icon 1)
-- Dateipfad festlegen
set dateiPfad to (path to desktop as string) & "test.txt"
-- Text in Datei schreiben
writeToFile(theText, dateiPfad, false)
-- Handler, um Texte in Dateien zu schreiben.
-- boolAppend = true: Text an vorhandene Datei anhängen
-- boolAppend = false: Text in Datei überschreiben
on writeToFile(theText, theFile, boolAppend)
-- ljr (applescript.bratis-lover.net/library/file/)
local theText, theFile, boolAppend, otf
try
set theFile to theFile as string
set otf to open for access file theFile with write permission
if boolAppend is false then set eof of otf to 0
write theText to otf starting at eof
close access otf
on error eMsg number eNum
try
close access file otf
end try
error "Can't writeToFile: " & eMsg number eNum
end try
end writeToFile-- Text abfragen
set theText to text returned of (display dialog "Bitte Text eingeben:" default answer "" with title "Texteingabe in Datei speichern" with icon 1)
-- Dateipfad festlegen
set dateiPfad to (path to desktop as string) & "test.txt"
-- Text in Datei schreiben
writeToFile(theText, dateiPfad, false)
-- Handler, um Texte in Dateien zu schreiben.
-- boolAppend = true: Text an vorhandene Datei anhängen
-- boolAppend = false: Text in Datei überschreiben
on writeToFile(theText, theFile, boolAppend)
-- ljr (applescript.bratis-lover.net/library/file/)
local theText, theFile, boolAppend, otf
try
set theFile to theFile as string
set otf to open for access file theFile with write permission
if boolAppend is false then set eof of otf to 0
write theText to otf starting at eof
close access otf
on error eMsg number eNum
try
close access file otf
end try
error "Can't writeToFile: " & eMsg number eNum
end try
end writeToFile
Es erstellt eine Text Datei auf dem Desktop. Man kann in eine Text eingabe etwas eingeben und das wird in die Text Datei gespeichert.
Mein Problem ist das ich den Pfad wohin die Text Datei Gespeichert wird nicht geändert bekomme habe.
Ich möchte sie in einen von mir erstellten Ordner in der Library Speichern.
Ich habe schon alles ausprobiert was ich weiß, aber in Pfade setzten in Applescript war ich noch nie gut.
Über eine Antwort würde ich mich freuen
Yannick
	
		
			
		
		
	
				
			ich habe folgendes Problem.
Ich habe dieses AppleScript aus dem Internet:
-- Text abfragen
set theText to text returned of (display dialog "Bitte Text eingeben:" default answer "" with title "Texteingabe in Datei speichern" with icon 1)
-- Dateipfad festlegen
set dateiPfad to (path to desktop as string) & "test.txt"
-- Text in Datei schreiben
writeToFile(theText, dateiPfad, false)
-- Handler, um Texte in Dateien zu schreiben.
-- boolAppend = true: Text an vorhandene Datei anhängen
-- boolAppend = false: Text in Datei überschreiben
on writeToFile(theText, theFile, boolAppend)
-- ljr (applescript.bratis-lover.net/library/file/)
local theText, theFile, boolAppend, otf
try
set theFile to theFile as string
set otf to open for access file theFile with write permission
if boolAppend is false then set eof of otf to 0
write theText to otf starting at eof
close access otf
on error eMsg number eNum
try
close access file otf
end try
error "Can't writeToFile: " & eMsg number eNum
end try
end writeToFile-- Text abfragen
set theText to text returned of (display dialog "Bitte Text eingeben:" default answer "" with title "Texteingabe in Datei speichern" with icon 1)
-- Dateipfad festlegen
set dateiPfad to (path to desktop as string) & "test.txt"
-- Text in Datei schreiben
writeToFile(theText, dateiPfad, false)
-- Handler, um Texte in Dateien zu schreiben.
-- boolAppend = true: Text an vorhandene Datei anhängen
-- boolAppend = false: Text in Datei überschreiben
on writeToFile(theText, theFile, boolAppend)
-- ljr (applescript.bratis-lover.net/library/file/)
local theText, theFile, boolAppend, otf
try
set theFile to theFile as string
set otf to open for access file theFile with write permission
if boolAppend is false then set eof of otf to 0
write theText to otf starting at eof
close access otf
on error eMsg number eNum
try
close access file otf
end try
error "Can't writeToFile: " & eMsg number eNum
end try
end writeToFile
Es erstellt eine Text Datei auf dem Desktop. Man kann in eine Text eingabe etwas eingeben und das wird in die Text Datei gespeichert.
Mein Problem ist das ich den Pfad wohin die Text Datei Gespeichert wird nicht geändert bekomme habe.
Ich möchte sie in einen von mir erstellten Ordner in der Library Speichern.
Ich habe schon alles ausprobiert was ich weiß, aber in Pfade setzten in Applescript war ich noch nie gut.
Über eine Antwort würde ich mich freuen
Yannick
 
 
		
 
 
		 
 
		 
 
		 
 
		