Re: What is the limit on osascript command ?
Re: What is the limit on osascript command ?
- Subject: Re: What is the limit on osascript command ?
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 9 Apr 2008 07:39:59 -0400
EOSCRIPT is just the word Philip picked to indicate the end of the
script, presumably short for "End Of SCRIPT". You can use any word
you want as long as that word doesn't show up by itself at the
beginning of a line inside the text...
The point is, the command line in Unix has an upper size limit. Most
language interpreters have an option to pass a string of code to
interpret on the command line (bash -c, perl -e, php -r, cmd.exe/c,
etc) but that is a convenience for short one-liners, not the way
you're supposed to feed code to the interpreter in general. Usually
you pass in a file containing the code; since a stream of data coming
through a file descriptor doesn't have a size limit (though the file
system will have an upper limit on the size of the file on disk). A
here-document is essentially a way of constructing and passing a
temporary file on the fly.
On 4/9/08, Paul Taylor <email@hidden> wrote:
> hi , thanks Ill try it but what is EOSCRIPT I cant find an explanation ?
> Philip Aker wrote:
> > On 08-04-09, at 00:05, Paul Taylor wrote:
> >
> >> Is there a limit on how long an applescript command can be, Im
> >> attempting to update details of tracks chnaged outside of itunes in
> >> Itunes, the script works when I am not updating many files but seems
> >> to fail as the number of files I update gets larger. Failing with either
> >> return code 1 or 255. the Applescript is actually generated by
> >> another language which is why I use the -e option many times.
> >> Apologies that my
> >> applescript knowledge is VERY slim Im only using it because it is the
> >> only way I can interact with iTunes.
> >
> > Not AppleScript itself but possibly the limit of tool argument size --
> > 256K -- somewhere in your chain.
> > You might want to look into another form for your script:
> >
> > osascript -e << EOSCRIPT
> > tell application "iTunes"
> > blah, blah blah
> > -- 1000 lines of code
> > blah, blah
> > blah
> > end tell
> > EOSCRIPT
> >
> >
> >
> >> thanks for any help Paul
> >>
> >> Here is an example of the command I run, (but Ive stripped out many
> >> of the -e add lines in the real script) in either returns error code
> >> 1 or 255
> >>
> >> osascript -e tell app "iTunes" -e set new_playlist to (make user
> >> playlist with properties {name:"newPlaylist:3/19/08 7:45 PM"})
> >> -e add(POSIX file "/Volumes/LaCie Disk/Marchive/Gone In 60
> >> Seconds/Soundtrack to Gone In 60 Seconds/Moby - Flower.mp3") to
> >> new_playlist
> >> -e add(POSIX file "/Volumes/LaCie Disk/Marchive/George Thorogood/The
> >> Baddest of George Thorogood and the Destroyers/Move It on Over.mp3")
> >> to new_playlist
> >> -e add(POSIX file "/Volumes/LaCie
> >> Disk/Marchive/Glorytellers/Glorytellers/Tears of....mp3") to
> >> new_playlist
> >> -e repeat with nexttrack in (get every track of new_playlist)
> >> -e refresh nexttrack
> >> -e end repeat
> >> -e end tell
> >
> >
> > Philip Aker
> > echo email@hidden@nl | tr a-z@. p-za-o.@
> >
> >
> >
> >
> >
> >
>
> _______________________________________________
> 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
>
--
Sent from Gmail for mobile | mobile.google.com
Mark J. Reed <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