How To Manipulate A Result


tell application "Finder"
	activate
	make new Finder window
	set target of front Finder window to folder "test" of desktop
	get items in front Finder window
end tell

Hi All! I’d like to learn ways I can manipulate the results of my scripts. For instance, the result of the above script is:


{document file "Untitled.rtf" of folder "Test" of folder "Desktop" of folder "CFCRC-Tech" of folder "Users" of startup disk of application "Finder"}

How can I then rename the document file my script has just produced using the get items line?

set name of item 1 of result to “name”

Got it!

You may use a shorter code :

tell application "Finder"
	activate
	set name of item 1 of (get items of folder "test" of desktop) to "my beautiful text.rtf"
end tell

Yvan KOENIG running El Capitan 10.11.0 in French (VALLAURIS, France) jeudi 3 septembre 2015 20:54:27