Re: POSIX path with osascript
Re: POSIX path with osascript
- Subject: Re: POSIX path with osascript
- From: Doug McNutt <email@hidden>
- Date: Wed, 27 Jan 2010 14:58:52 -0700
At 22:02 +0100 1/27/10, Jay Louvion wrote:
Hi all, I'm trying to get a script to select and reveal files in the Finder, using osascript and passing a variable list called argv whose item 1 is a folder path and the next items are the file names. I don't know why, but it seems as though there si no way of using POSIX path in this case. Will I have to do a subroutine to find and replace "/" by ":"
I find it more convenient to put as much of the POSIX path stuff in my shell scripts and only go to AppleScript when I need to do something like "tell Finder I love you". My shell - tcsh - and I'm sure others allow for simple loops and osascript can be called as a here variable like this:
set WORK="/Path/to/the/folder"
for xxx ( filename[0-9],jpg)
osascript << ENDSCRIPT
tell application "Finder"
try
set FileAlias to file $WORK/$xxx
. . .
end try
end tell
ENDSCRIPT
end
Those shell variables will get expanded the way POSIX paths should. There is some time penalty for calling osascript over and over but I haven't noticed it.
--
->The US of A is getting pelloreid <-
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden