Make the "FIND APPLICATION" Dialog dissapear!

I’ve been at this for some time now but i don’t get it right,

As part of my script I want to tell VLC to go into fullscreen mode.

At first, if VLC was missing, I got the “find application” dialog directly at startup of my script.
I then added the using terms from “VLC” making the code look like this.

using terms from application “VLC”
tell application appName
fullscreen
end tell
end using terms from

With this code I can now start and run my script with VLC missing without having to see the “find application” dialog. So far so good…

But if VLC.app is renamed to say “VLC0.8.4.app” I still have the same problems when trying to execute the part of the script seen above. When I should be getting fullscreen in VLC I get a dialog box instead asking me to locate “VLC”

The variable “appName” above always contains the current name of the VLC application, but it seems to be impossible to use it with the “using terms from…” statement.

I reed at this page http://members.lycos.co.uk/scripting/ about using “raw” commands to avoid this kind of problems but I don’t understand how to get which “raw” commands to use.

Does anyone have any suggenstions?

Hi, I’m not sure I understand what you’re trying to do. If you’re just trying to make VLC go into fullscreen mode, this script works for me:

tell application "VLC 8.4" to activate
tell application "System Events" to keystroke "f" using command down

well obviously that would work, until some other user somewhere desides not to rename thir VLC application to VLC0.8.4.app.

So this is not what i’m asking. But thanks anyway :wink:

I need to be able to call an application specific command for a known application with unknown name.

Since people sometimes rename thier copys of programs for some unknown resons.

On my machine, the above script works even if I change the name of VLC.

The other thing I tried was this:

tell application "Finder"
	
	set VLCapp to application whose version contains the text "VLC"
	
	tell application VLCapp to activate

Now this does NOT work for me, either my syntax is wrong or Applescript can’t search the version comments. Maybe a more experienced scripter has a better solution for you…

One other thing you could try:

--Starts VLC or makes it active application
do shell script "cd /Applications; open *VLC*"

--Set it to Fullscreen Mode
tell application "System Events" to keystroke "f" using command down

As long as VLC is in the Application folder and contains the text “VLC” this would work, even if they rename it to “VLC0.8.4.app” or “Really Cool Media Player VLC.app”.

Torajima

I keep my VLC.app and all its documentation in its folder, this. works for me.

tell application "Finder"
	set the appsfolder to folder "Macintosh HD:applications"
	set vlc to (items of appsfolder whose name contains "vlc") as alias
	my vlc_check(vlc)
end tell
on vlc_check(vlc)
	tell application "Finder"
		if name of vlc contains ".app" then
			set appName to name of vlc
			open file vlc
			delay 1
			tell application vlc
				tell application "System Events" to keystroke "f" using command down
			end tell
		else
			set vlc to (items of vlc whose name contains "vlc") as alias
			my vlc_check(vlc)
		end if
	end tell
end vlc_check