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

chrispoole

macrumors newbie
Original poster
Sep 26, 2007
28
0
Hi, I'm trying to get this to work:

Code:
tell application "Finder"
	reveal {"/Users/Chris/test/test.pdf", "/Users/Chris/test/test.log"} as POSIX file
end tell

Basically, just reveal the files, several selected at once.

It doesn't work though, and I've searched round to find a solution but can't get anything to work.

Can anyone help please?
 

andmr

macrumors member
Aug 25, 2008
31
0
NE Florida
Since the two items in your example list reside within the same folder, all you'd really need to do is reveal the items' enclosing folder. Once this folder is revealed, the two files should be plainly visible. Try this:

Code:
tell application "Finder"
	reveal folder ((path to home folder as text) & "test:")
end tell

If, however, you want to take it a step further and actually select (highlight) any folder items which appear on the list, you might try this:

Code:
set my_list to {"test.pdf", "test.log"}
tell application "Finder"
	set my_folder to reveal folder ((path to home folder as text) & "test:")
	select (every item of my_folder whose name is in my_list)
end tell

To test that only listed items get highlighted, try adding non-list items to the test folder, and then rerun the script.

Good luck.
 

balasoundiram

macrumors newbie
Sep 18, 2014
1
0
I'm trying to select folders/files located within the parent folder. Any suggestion on how to do this.
Code:
set my_list to {"Published", "Working", "Published:PDF"}
tell application "Finder"
	set my_folder to reveal folder ((path to desktop folder as text) & "325811-1:" )
	select (every item of my_folder whose name is in my_list)
end tell
I'm trying to locate 'PDF' folder located under 'Published' folder. Any thought on how to do this
 
Last edited by a moderator:

jeromes

macrumors newbie
Jan 14, 2018
2
0
Hi, I'm trying to get this to work:

Code:
tell application "Finder"
    reveal {"/Users/Chris/test/test.pdf", "/Users/Chris/test/test.log"} as POSIX file
end tell

Basically, just reveal the files, several selected at once.

It doesn't work though, and I've searched round to find a solution but can't get anything to work.

Can anyone help please?
The answer is a bit late, but the following should work:
AppleScript:
tell application "Finder"
    reveal {"/Users/Chris/test/test.pdf" as POSIX file, "/Users/Chris/test/test.log" as POSIX file}
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.