• 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: A script to create another script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A script to create another script


  • Subject: Re: A script to create another script
  • From: John Delacour <email@hidden>
  • Date: Tue, 17 Jun 2003 20:20:45 +0100
  • Mac-eudora-version: 6.0a21

At 11:50 am -0500 17/6/03, Joseph Weaks wrote:

I'm trying to do it with do script osacompile.
...
Now, the text of the script that is being created in my thinking needs to begin with:
Property thisVariable: [the list of lists mentioned above]
Property thatVariable: [the list of aliases]

Of course, if I try:

set scriptText to "Property thisVariable: " & Var1 & "
Property thatVariable: " & Var2 & "...

the lists get coerced into strings

Is there another option other than osacompile I should be trying?

Probably man gulp or something, but I'd use store script. You son't need to deal with strings at all, just with a script object:


set listOfRecords to {{a:1, b:2}, {c:2, d:4}}
set listOfAliases to {path to "cusr"}
set script_2_path to "" & (path to "cusr") & "script_2"

script script_2
property prop1 : ""
property prop2 : ""
end script

tell script_2
set its prop1 to listOfRecords
set its prop2 to listOfAliases
end tell
store script script_2 in file script_2_path with replacing

-- Test the result
set trialrun to load script file script_2_path
tell trialrun to get item 1 of its prop1


-- JD






.
_______________________________________________
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: A script to create another script
      • From: Joseph Weaks <email@hidden>
References: 
 >A script to create another script (From: Joseph Weaks <email@hidden>)

  • Prev by Date: Re: AppleScript Timed Events
  • Next by Date: Re: Suppressing error messages
  • Previous by thread: A script to create another script
  • Next by thread: Re: A script to create another script
  • Index(es):
    • Date
    • Thread