Re: Applications not on client machines and choices
Re: Applications not on client machines and choices
- Subject: Re: Applications not on client machines and choices
- From: kai <email@hidden>
- Date: Fri, 9 Dec 2005 01:01:56 +0000
On 8 Dec 2005, at 22:47, David A. Cox wrote:
I am writting an application in AppleScript Studio. It does a bunch
of things, one of which is to start recording audio. I do not have
the skill set handy to write a built in audio recorder, so I want
to give users of the application the choice of using QuickTime Pro,
QuickTime Broadcaster, or Audio Hijack Pro to do the recording.
The problem is that when I run the program on a client machine, it
requests info on where QuickTime Broadcaster and Audio Hijack Pro
are if they are not installed, even if they are not selected as the
apps that will be doing the recording. I assume this is so that
the application can understand the dictionary terms for the
applicaitons. I do not want to have to develop 3 versions of the
applicaiton (one for each of the recording options) and so I am
contacting you.
A simplified example that shows the problem would be to make a new
AppleScript Studio applicaiton in Xcode, and use interface builder
to make a windwo with 3 buttons. The applescript names of the
buttons would be QTP, QTB, AHP. The buttons all point back to the
same script, which is this:
[see modified version below]
I would like to be able to run this on any system that has ANY ONE
of the options avaliable, and have it work for that option.
Currently, when such an app is launched, it wants to know where ALL
of the applications that are scripted are at if it does not find
them on the system.
Has anyone worked out a way around this? I got close with some
variable setting for the application names, but that did not help
once I started to write commands based on items from the
applicaitons specific dictionaries. I need to do things that make
using "system events" only very hard.
One way around this issue is to use a variable for the application
name, David. To get the script to compile, you can use a series of
'using terms from' statements. The compile machine will still need
all three applications onboard, but the approach should avoid any
further checking for terms at runtime. Here's a suggested
modification (albeit untested here):
-----------------------
on clicked theObject
if the name of theObject is "QTP" then
set appName to "QuickTime Player"
using terms from application "QuickTime Player"
tell application appName
new audio recording
tell front movie to start
end tell
end using terms from
else if the name of theObject is "QTB" then
set appName to "QuickTime Broadcaster"
using terms from application "QuickTime Broadcaster"
tell application appName
start document 1
end tell
end using terms from
else if the name of theObject is "AHP" then
set appName to "Audio Hijack Pro"
using terms from application "Audio Hijack Pro"
tell application appName
start hijacking session named "Default System Input"
start recording session named "Default System Input"
end tell
end using terms from
end if
end clicked
-----------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden