• 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: AppleScript and shell scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript and shell scripting


  • Subject: Re: AppleScript and shell scripting
  • From: Deivy Petrescu <email@hidden>
  • Date: Mon, 28 Dec 2015 17:21:38 -0500

> On Dec 27, 2015, at 11:36 , Maik Waschfeld <email@hidden> wrote:
>
> Hi List,
>
> I'm on Mac OS X 10.11.2 and do have problems with AppleScript and the shell scripting.
>
> The following script is a cut-out from a larger project:
>
>
>
>
> tell application "Finder"
> 	set the_MePath to (path to me)
> 	set the_MeCont to (container of the_MePath) as string
> end tell
> set the_MeContShell to (text 1 thru -2) of the_MeCont
>
> --normaly not there!
> set the_MePara to (the_MeCont & "STH-C Para WAV_48k_24.txt")
>
> set the_Parameters to (open for access file the_MePara with write permission)
>
> write ("WAV\r24\r48000\r48k\r") to the_Parameters
>
> close access the_Parameters
> --normaly not there!
>
> --intended to be there!
> --set the_MePara to (do shell script "find " & quoted form of POSIX path of the_MeContShell & " -iname 'STH-C Para *'")
>
> set the_Parameters to (open for access file the_MePara)
>
> set the_ParaList to (read file the_MePara)
>
> close access the_Parameters
>
> set userFormat to paragraph 1 of the_ParaList
> set userBitDepth to paragraph 2 of the_ParaList
> set userSampleRate to paragraph 3 of the_ParaList
> set shortSampleRate to paragraph 4 of the_ParaList
>
>
>
>
> The lines between the "--normaly not there!"-lines fills a file in the AppleScript's directory with data.
>
>  So, now the file is there.
> If I delete these lines and activate the line below "--intended to be there!", the shell should find this file.
>
> What I get then, is an error:
>
> error "Fehler beim Zugriff auf das Netzwerk." number -5000 from file "/Users/Shared/_AppleScript Development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt" to «class fsrf»
>
> at "open for access file the_MePara".
>  Any idea, anyone?
>
>
> With kindest regards…
> …Maik Waschfeld
>
> (sent from my MBAir11)

According to the error, the problem is with network access not with the shell script.
Where is your "/Users/Shared/…” ?
Is it in another Volume?

I ran the following script without any problem here:

set the_MePath to (path to me)
tell application "Finder" to set the_MeCont to text 1 thru -2 of ((container of the_MePath) as string)
set the_MePara to (the_MeCont & "AttendanceNumbers.scpt")
set the_Parameters to (open for access file the_MePara with write permission)
close access the_Parameters

And if I run:

set the_MePara to (the_MeCont & "Attendance.scpt")
do shell script "find " & quoted form of POSIX path of the_MeCont & " -iname  Attendan*”

it finds the file.

Deivy Petrescu
email@hidden




 _______________________________________________
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: AppleScript and shell scripting
      • From: Maik Waschfeld <email@hidden>
References: 
 >AppleScript and shell scripting (From: Maik Waschfeld <email@hidden>)

  • Prev by Date: Re: Apple Configurator 2 (was Re: El Capitan)
  • Next by Date: Re: AppleScript and shell scripting
  • Previous by thread: Re: AppleScript and shell scripting
  • Next by thread: Re: AppleScript and shell scripting
  • Index(es):
    • Date
    • Thread