Re: Tell application variable for remote service
Re: Tell application variable for remote service
- Subject: Re: Tell application variable for remote service
- From: Luther Fuller <email@hidden>
- Date: Thu, 20 May 2010 08:15:36 -0500
On May 20, 2010, at 4:39 AM, Stéphane VAXELAIRE wrote: I searched the lists (and google of course) about being able to use some variable for a : tell application "remote_service_url" to make an XML RPC call. I'd like to be able to write "tell application some_url" in a function where some_url would be a function parameter. I don't like that URL to be hardcoded in my scripts.
I can't find anything that would let me know it is possible though...
Here's a snippet of code from Script Bundle Tool that runs only if the user is calling SBT to compile a script currently open in Smile. It was written so that users who did not have Smile would not be asked "Where is Smile?" every time they launched SBT.
if frontProc is "Smile" then "tell application \"Smile\"" & return & "activate" & return & ¬ "if class of window 1 is not script window then error" & return & ¬ "save window 1" & return & "path name of window 1" & return & "end tell" try set docAlias to (run script the result) as alias on error error "Smile's frontmost window is not a script window or" & return & "Smile can't find the saved copy of the current document." & return & ¬ "Save it to a project folder and try again." -- window 1 has no associated file end try else if frontProc is in {"AppleScript Editor", "Script Editor"} then
else if frontProc is "Finder" then else error "The frontmost application must be the Finder," & return & "Smile or Script Editor." end if
"Smile" is hardcoded into this code, but you could use a variable, if you wish.
|
_______________________________________________
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