• 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: What is the limit on osascript command ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the limit on osascript command ?


  • Subject: Re: What is the limit on osascript command ?
  • From: Paul Taylor <email@hidden>
  • Date: Wed, 09 Apr 2008 14:36:41 +0100

Hi

It didnt work, in fact even with a shorter script that used to work it failed. Im generating the script from within a java program, maybe there is some problem with quoting characters it is very difficult to tell because
Applescript appears very sensitive to whitespace never mind control chars. Im going to try writing the script to a file and then using osascript on the file, that should at least remove the quoting of shell characters problem. Sound like a good idea ?


Paul

Mark J. Reed wrote:
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



_______________________________________________ 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: What is the limit on osascript command ?
      • From: Laine Lee <email@hidden>
    • Re: What is the limit on osascript command ?
      • From: Doug McNutt <email@hidden>
    • Re: What is the limit on osascript command ?
      • From: Philip Aker <email@hidden>
References: 
 >What is the limit on osascript command ? (From: Paul Taylor <email@hidden>)
 >Re: What is the limit on osascript command ? (From: Philip Aker <email@hidden>)
 >Re: What is the limit on osascript command ? (From: Paul Taylor <email@hidden>)
 >Re: What is the limit on osascript command ? (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: What is the limit on osascript command ?
  • Next by Date: Re: What is the limit on osascript command ?
  • Previous by thread: Re: What is the limit on osascript command ?
  • Next by thread: Re: What is the limit on osascript command ?
  • Index(es):
    • Date
    • Thread