• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: POSIX path with osascript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX path with osascript


  • Subject: Re: POSIX path with osascript
  • From: Jay Louvion <email@hidden>
  • Date: Wed, 27 Jan 2010 22:14:12 +0100
  • Thread-topic: POSIX path with osascript

Title: Re: POSIX path with osascript

Hi Alex,

A soon as I try to get anything from the path (item 1), I get an error saying the “file” [=folder path] doesn’t exist. The problem lies specifically with the path being in the wrong (/) format...
So let alone calling a container.


On 27.01.2010 22:07, "Alex Zavatone" <email@hidden> spake thus:

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



j.

Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva

T+4122 840 3272
F+4122 840 3271

www.studiocasagrande.com

P Please consider the environment before printing this email.

 _______________________________________________
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

  • Follow-Ups:
    • Re: POSIX path with osascript
      • From: Alex Zavatone <email@hidden>
References: 
 >Re: POSIX path with osascript (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: POSIX path with osascript
  • Next by Date: Re: POSIX path with osascript
  • Previous by thread: Re: POSIX path with osascript
  • Next by thread: Re: POSIX path with osascript
  • Index(es):
    • Date
    • Thread