Hello,
I have written a short AppleScript to import a link to a web site as plain text. I mostly just copied code from one of the import scripts https://c-command.com/scripts/eaglefiler/, and I wonder if it is possible to after importing open a record via the records id and x-eaglefiler URLs or with some similar approach.
I have made two versions of the script as Automator Quick Actions. One which imports the link adds notes and hides EagleFiler, and in the other version I would like the ability to open the newly added record for adding some notes or description about the link. I prefer not to have System Events.app activated in Accessibility on my system so GUI scripting is not an alternative.
I thought maybe it is possible to open a record with ‘get url’ and an x-eaglefiler URL and the record’s id supplied.
The above idea is for convenience and not very important, but if it is possible it would be convenient.
Regards,
Martin
on run {input, parameters}
tell application "EagleFiler"
activate
set _content to (the clipboard as text)
set _rv_title to display dialog "Titel till länken i EagleFiler:" default answer "" with icon note buttons {"Cancel", "OK"} default button "OK" with title _content
set _title to text returned of _rv_title
set ef_library_path to POSIX file "/path/to/eaglefiler/EagleFiler.eflibrary"
set _ef_library to ef_library_path as alias
if button returned of _rv_title = "OK" then
try
open _ef_library
tell library document 1
set {_record} to import plain text _content note _content -- add _content to note as source URL cannot be copied from Get Info window
set _record's title to "URL: " & _title
set _record's source URL to _content
end tell
on error
display alert "Kunde inte öppna EagleFilers library: " & ef_library_path
end try
else
-- user canceled operation
end if
end tell
return input
end run