View Full Version : UNIX command "Touch" as droplet?
does anyone know if it is possible to create a droplet performing the UNIX command "Touch" on the files dropped on it? This is in OSX of course.
Thanks
cudaboy_71
2004-08-31, 22:42
i can give you a damn good start.
on run
tell application "Finder"
set change_list to selection
end tell
open change_list
end run
on open change_list
tell application "Finder"
repeat with thefile in change_list
set newFile to POSIX path of thefile
do shell script "touch " & newFile & ""
end repeat
end tell
end open
i havent even tested this. but, it should be a hearty shove in the right direction. the main thing to note is the 'do shell script' line. with that you can basically paste any shell code and execute from an applescript. the " &newFile &" lets you create a list of files to 'operate on' in the finder, and process them in the shell.
also of note--there is no escape character handling. im sure you can do a little searching to find/lift some code.
good luck. let us know if you get it working (and paste the working code)
thanks cuda.. since i posted last i managed to get some help from the apple forums. the script is working perfectly!
get it from mu iDisk: hot.tamales! finlename=Touch
peace
I have a related question, how would you do a script that is put in the Finder toolbar, and just makes (touches) a new empty file in the current folder, and puts focus to the filename so you can write your own?
Never done a single script...
vBulletin® v3.6.4, Copyright ©2000-2024, Jelsoft Enterprises Ltd.