Integration script for Neofinder (cdfinder)

Hallo, die Intelligenz hat mir freundlicherweise die Skripte für den Neo-Finder gegeben.
Hi, the Intelligence was kind enough to give me the scripts for the Neo-Finder.

get-name

-- Hookmark: Get Name für NeoFinder (de.wfs-apps.neofinder)
-- Titel = Objektname plus Katalog, z. B. "Projekt_0125 (NeoFinder: volume1)"
tell application "NeoFinder"
	set sel to selected items
	if (count of sel) is 0 then return ""
	set theItem to item 1 of sel
	set itemName to name of theItem
	set fullPath to complete path of theItem
end tell

set AppleScript's text item delimiters to ":"
set catName to text item 1 of fullPath
set AppleScript's text item delimiters to ""

return itemName & " (NeoFinder: " & catName & ")"

get-address

-- Hookmark: Get Address für NeoFinder (de.wfs-apps.neofinder)
-- Liefert eine neofinder://-Such-URL für das erste ausgewählte Katalogobjekt.
-- Funktioniert auch, wenn das katalogisierte Volume offline ist.
use framework "Foundation"
use scripting additions

tell application "NeoFinder"
	set sel to selected items
	if (count of sel) is 0 then return ""
	set theItem to item 1 of sel
	set itemName to name of theItem
	set itemKind to kind of theItem
end tell

if itemKind is in {"Ordner", "Folder"} then
	set findType to "folder"
else
	set findType to "file"
end if

set allowed to current application's NSCharacterSet's URLQueryAllowedCharacterSet()'s mutableCopy()
allowed's removeCharactersInString:"&=+#/?"
set encName to ((current application's NSString's stringWithString:itemName)'s stringByAddingPercentEncodingWithAllowedCharacters:allowed) as text

return "neofinder://find/" & findType & "/&name=" & encName

:slight_smile: