• 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
Trying to script the creation of a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to script the creation of a script


  • Subject: Trying to script the creation of a script
  • From: Christian Boyce <email@hidden>
  • Date: Sun, 22 Feb 2004 15:26:35 -0800

I'm trying to make a droplet script that makes another script. The second script would be customized, based on the name of the file dropped. I've gotten as far as creating the new Script Editor document automatically, with text as desired, but I haven't figured out how to pass the name of the dropped file to the new script.

Here's what I have:

on open thefile
tell application "Finder"
set y to thefile as alias
set thename to the name of y
end tell

tell application "Script Editor"
activate
--this is where we create the text that makes up the script.
--it is also where the problem lies.
set x to "tell application \"2.0TitleTrack Jukebox\" of machine \"eppc://192.168.1.100\"
Stop
Clear
end tell
--
tell application \"Finder\" of machine \"eppc://192.168.1.100\"
open file\" & thename & \"of folder \"TitleTrack Jukebox v2.0\" of startup disk
end tell
--
tell application \"2.0TitleTrack Jukebox\" of machine \"eppc://192.168.1.100\"
activate
Set Loop true
Play
end tell"
--now we make the script
make new document with properties {text:x}
end tell
end open


What happens is I create a script that's absolutely perfect, except that the variable "thename" is shown as "thename" and not as what "thename" actually stands for. That is, I want the value of "thename" to be shown in the script, not literally "thename."

In the end of course I'll want to save the script, also using the "thename" variable's contents, so if anyone can help with that I'd appreciate it too. Thanks.

(The point here is I am using TitleTrack Jukebox to play CDs, and I want to create scripts that trigger playlists. The playlists are named files, so I want scripts that open those playlists and play them. I will eventually add those playlist scripts to Drag Thing tiles. And, I'll make the whole thing a folder action, so when I add a playlist to a folder, a new tile will show up in Drag Thing. That's the plan.)


--
Christian Boyce
http://www.christianboyce.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Trying to script the creation of a script
      • From: Andrew Oliver <email@hidden>
    • Re: Trying to script the creation of a script
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Date Modified
  • Next by Date: Re: Trying to script the creation of a script
  • Previous by thread: Re: Date Modified
  • Next by thread: Re: Trying to script the creation of a script
  • Index(es):
    • Date
    • Thread