Re: "cd " and "tail -f" on a file
Re: "cd " and "tail -f" on a file
- Subject: Re: "cd " and "tail -f" on a file
- From: Paul Skinner <email@hidden>
- Date: Mon, 17 Mar 2003 14:53:28 -0500
Actually, I was misled by an errant failure. The name extention code is
completely unnecessary.
set f to (choose file)
tell application "Finder"
set c to quoted form of POSIX path of ((container of f) as alias)
set n to name of f
end tell
tell application "Terminal"
activate
do script "cd " & c & " ; tail -f " & n
end tell
or for those finder-averse among you. : )
set f to (choose file) as string
set AppleScript's text item delimiters to ":"
set c to quoted form of POSIX path of ((text items 1 thru -2 of (f as
string)) as string)
set n to text item -1 of f
set AppleScript's text item delimiters to ""
tell application "Terminal"
activate
do script "cd " & c & " ; tail -f " & n
end tell
Paul Skinner
On Monday, March 17, 2003, at 12:26 PM, Paul Skinner wrote:
On Monday, March 17, 2003, at 11:05 AM, Todd Reid wrote:
Paul,
This works (thank you), returning a correct list of the files in the
targeted directory.
HOWEVER, what I need is to ultimately "tail -f" a file in that
directory in
the Terminal itself.
So when I direct this script (accounting for the "do script" vs "do
shell
script" differences") to the Terminal, I get a permissions denied
error.
Thanks,
Todd
Ok, getting closer. : ) Now try this one.
set f to (choose file)
tell application "Finder"
set c to quoted form of POSIX path of ((container of f) as alias)
set n to name of f
if extension hidden of f then
set e to name extension of f
else
set e to ""
end if
end tell
tell application "Terminal"
activate
do script "cd " & c & " ; tail -f " & quoted form of (n & e)
end tell
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.