Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

maxrealqnx

macrumors newbie
Original poster
Hi my friends.

it says always, there is not file. Please help me 😱



tell application "Finder"
set MyName to do shell script "whoami"
if {exists POSIX file "/Users/" & MyName & "/Library/Preferences/pbs.plist"} then
try
display dialog "File Exist" buttons {"OK"} default button 1 with title "Test1" with icon 0
end try
else
display dialog "File Not Exist" buttons {"OK"} default button 1 with title "Test1" with icon 0

end if
end tell
 
Hi my friends.

it says always, there is not file. Please help me 😱



tell application "Finder"
set MyName to do shell script "whoami"
if {exists POSIX file "/Users/" & MyName & "/Library/Preferences/pbs.plist"} then
try
display dialog "File Exist" buttons {"OK"} default button 1 with title "Test1" with icon 0
end try
else
display dialog "File Not Exist" buttons {"OK"} default button 1 with title "Test1" with icon 0

end if
end tell

Thank you for not helping me. Goodbye forever. 😛
Code:
set MyName to do shell script "whoami"
set openfile to "/Users/" & MyName & "/Library/Preferences/pbs.plist"
set pbsplist to POSIX file openfile

tell application "Finder"
	if {exists pbsplist} then
		try
			display dialog "File Exist" buttons {"OK"} default button 1 with title "Test 2" with icon 0
		end try
	else
		display dialog "File Not Exist" buttons {"OK"} default button 1 with title "Test 2" with icon 0
	end if
end tell
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.