Run AppleScript

You have a constant myscript2 and a method myscript2.
I have deleted the method and changed the myscript2 Constant

Download

Tell app “Finder” display dialog “HI” end

that’s wrong

for display dialog you don’t need Finder.

I changed it to
osascript -e ‘display dialog “HI”’

For 1 Line you can use osascript -e

for multiple use

/usr/bin/osascript <<-EOF
line 1
line 2
line 3
EOF

still getting this error message

https://dl.dropboxusercontent.com/u/2159257/alex3.jpg

duh…didnt read the part about a method myscript2. I deleted the method, it works. I am just wondering how scripts will run without the Tell app “Finder” command. We’ll see shortly. 8pm here is Virginia, thanks for all your help all the way from Germany.

below is a script that does not work using your constant technique. any ideas how to make it work. thanks for all your help. Probably because I need to tell it to look at “Finder window 1”.

tell application “Finder”
set the_mixes to every item of Finder window 1

repeat with an_item in the_mixes
	set file_name to name of an_item -- "AR123 India Eye Surgery v1 - Full mix.png"
	
	if file_name contains "full mix" then
		set base_name to characters 1 thru -17 of file_name as string
		set the_version to " " & word -3 of file_name -- v1
		set fullmix to " Full Mix"
		set name of an_item to base_name & fullmix & the_version & ".wav"
	end if
	
	
	if file_name contains "SOT mix" then
		set base_name to characters 1 thru -16 of file_name as string
		set the_version to " " & word -3 of file_name -- v1
		set sotmix to " SOT Mix"
		set name of an_item to base_name & sotmix & the_version & ".wav"
	end if
	
	
	if file_name contains "M&E mix" then
		set base_name to characters 1 thru -16 of file_name as string
		set the_version to " " & word -4 of file_name -- v1
		set memix to " M&E Mix"
		set name of an_item to base_name & memix & the_version & ".wav"
	end if
	
	
end repeat

end tell

for long scripts use the AppleScript file.

Save the script, drag it to Xojo, call it by name

You can test it (and edit) in the AppleScript-Editor. (right Click in Xojo - Open File)

can you please tell me how to call it by name, this is my 1st day with xoxo. thanks.

got it, you’re a genius, thanks a million.

@Axel Schneider , I must say you have the patience of Job (biblical).