Re: POSIX path with osascript
Re: POSIX path with osascript
- Subject: Re: POSIX path with osascript
- From: Alex Zavatone <email@hidden>
- Date: Wed, 27 Jan 2010 15:07:43 -0600
Can you try getting the container of the file and telling Applescript to open the folder?On Jan 27, 2010, at 3:02 PM, 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 “:”
Here is my code for the moment.
osascript /Path/to/the/script.scpt /Path/to/the/folder filename1.jpg filename2.jpg filename3.jpg filename4.jpg
This is the content of the script called from the osascript:
on run argv
tell application "Finder"
try
set AliasList to {}
set FolderPath to item 1 of argv
repeat with FileName in (items 2 thru end of argv)
set FileAlias to (POSIX path of FolderPath as text) & "/" & FileName as string as alias
set AliasList to AliasList & FileAlias
end repeat
select AliasList
activate
reveal selection
on error mistake number nmr
if nmr is not -128 then
activate
display dialog "error number " & nmr & return & mistake
end if
end try
end tell
end run
|
_______________________________________________
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