AppleScript to show package contents of hidden original of alias
folder "Contents" of
also works with aliases:
on run {input, parameters}
tell application "Finder"
repeat with f in input
open folder "Contents" of f
end repeat
end tell
end run
You can also assign a shortcut for showing package contents from System Preferences:
Command-R shows the original file of an alias.
You can try something like this:
on run {input, parameters}
tell application "Finder"
repeat with oneItem in input
if kind of oneItem = "Alias" then set oneItem to oneItem's original item
set contentsPath to (oneItem as text) & "Contents"
if oneItem's container as text = (path to desktop as text) then
open contentsPath
else
set target of window 1 to contentsPath
end if
activate
end repeat
end tell
end run
You may also want to include a test to make sure the input is the expected type.