Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Its is not very clear HOW you are trying to run it in Termanil. But I will assume you have saved a applescript text file with the #!/usr/bin/osascript , chmod 'ed the file to be able to execute it.</p> <p>Then called the file in Terminal. by just using the path to the file.</p> <p>Updated: use echo</p> <pre><code> #!/usr/bin/osascript #Here be the rest of your code ... set output to ("Song: " &amp; song &amp; " - " &amp; artist &amp; " - " &amp; album) do shell script "echo " &amp; quoted form of output end tell </code></pre> <p><strong>Update</strong> 2 , in reponse to comments.</p> <p>If I have a tab delimitated text file with the content as:</p> <pre><code>track Skin Deep Beady Belle Closer </code></pre> <p>The tabs are set like : track*<strong><em>TAB</em></strong><em>Skin Deep</em><strong><em>TAB</em></strong><em>Beady Belle</em><strong><em>TAB</em></strong>*Closer</p> <p>And the script file as :</p> <pre><code>on run fileName set unique_songs to paragraphs of (read POSIX file fileName) repeat with nextLine in unique_songs if length of nextLine is greater than 0 then set AppleScript's text item delimiters to tab set song to text item 2 of nextLine set artist to text item 3 of nextLine set album to text item 4 of nextLine set output to ("Song: " &amp; song &amp; " - " &amp; artist &amp; " - " &amp; album) do shell script "echo " &amp; quoted form of output end if end repeat end run </code></pre> <p>The in Terminal run:</p> <pre><code>/usr/bin/osascript ~/Documents/testOsa2.scpt ~/Documents/testTab.txt </code></pre> <p>I get back : <em>Song: Skin Deep - Beady Belle - Closer</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload