Results 1 to 11 of 11

Thread: How to get a record's EagleFiler Record Link or recordGUID

  1. #1

    Default How to get a record's EagleFiler Record Link or recordGUID

    Hi,

    Is there a way to retrieve the record link or its recordGUID for a record I'm creating through AppleScript?

    I thought the what I'm looking for is (id of library record) but it seems like that is actually another internal value. What I need is obtaining something like:

    x-eaglefiler://open?library=ka.eflibrary&recordGUID=faXufISIT4qhs iuFCaEvVw
    or at least the recordGUID to construct the above myself.

    tia,

    A://

  2. #2

    Default

    Quote Originally Posted by alex View Post
    Is there a way to retrieve the record link or its recordGUID for a record I'm creating through AppleScript?
    After you create the record, just get its “URL” property. This will give you the x-eaglefiler URL with the recordGUID.

    The “id” property can also be used to identify records in a script. It’s more efficient than using GUIDs. However, if you will be persisting the URL or identifier, you should use the GUID because it will stay the same if the library’s database is rebuilt.

  3. #3

    Default

    1. Fantastic! Importing URLs, I confess that was the last property I was planning to try :-).

    2. Is there any way to tell EagleFiler to select the newly created record through AppleScript?

    So far the only idea I have is to do a

    Code:
    do shell script "open -a EagleFiler URL"
    but I'm wondering if there's a better way.

  4. #4

    Default

    Quote Originally Posted by alex View Post
    Is there any way to tell EagleFiler to select the newly created record through AppleScript?
    You can set the “selected records” property of the “browser window”. However, this currently requires that the source list has something selected that would contain the record. This is because the selection of the source list is not currently scriptable, although you could use GUI scripting to drive the “Go” menu.

  5. #5

    Default Can anyone clarify the GUID?

    Quote Originally Posted by Michael Tsai View Post
    After you create the record, just get its “URL” property. This will give you the x-eaglefiler URL with the recordGUID.

    The “id” property can also be used to identify records in a script. It’s more efficient than using GUIDs. However, if you will be persisting the URL or identifier, you should use the GUID because it will stay the same if the library’s database is rebuilt.
    I think this is what I want, but I can't quite figure it out. I'm looking for an immutable link to a record (i.e. a file). Right now, when I use "Copy Record Link" to link from another document I'm writing back to an EF file, it takes the entire URL. This gets disrupted if I change anything in the EF library structure, such as moving it to another drive, or moving the particular file to another folder.

    Is GUID an immutable link to a particular record? If so, why do I get no result if I search EF using the GUID? Is it an Apple file system thing, and not accessible to EagleFiler?

    Last, does anyone have another suggestion for creating unchanging links? I could randomly create a 10 digit number that I store in the Notes field, but that is clugey (sp?).

  6. #6

    Default

    Quote Originally Posted by Rbohn View Post
    I'm looking for an immutable link to a record (i.e. a file). Right now, when I use "Copy Record Link" to link from another document I'm writing back to an EF file, it takes the entire URL.
    That’s what the record link is intended for.

    Quote Originally Posted by Rbohn View Post
    This gets disrupted if I change anything in the EF library structure, such as moving it to another drive, or moving the particular file to another folder.
    It’s true that the path to the library will change if you move the library itself to a different folder or drive. However, if you have the library open, and then you click the link, EagleFiler will see that it has a library with the same name as the link, and it will look there for the record. Does that make sense?

    Quote Originally Posted by Rbohn View Post
    Is GUID an immutable link to a particular record?
    Yes.

    Quote Originally Posted by Rbohn View Post
    If so, why do I get no result if I search EF using the GUID?
    It might make sense to add that as a feature in the future, however right now EagleFiler only indexes the record’s contents and visible metadata for searching. How would searching by GUID be better for you than just clicking the link?

    Quote Originally Posted by Rbohn View Post
    Is it an Apple file system thing, and not accessible to EagleFiler?
    No, the GUID is an EagleFiler thing. It’s only stored in EagleFiler’s database, not in the file itself.

    Quote Originally Posted by Rbohn View Post
    Last, does anyone have another suggestion for creating unchanging links?
    What are you trying to accomplish that isn’t currently possible?

  7. #7

    Default Update: unique ID for files

    Quote Originally Posted by Michael Tsai View Post
    That’s what the record link is intended for.

    It might make sense to add that as a feature in the future, however right now EagleFiler only indexes the record’s contents and visible metadata for searching. How would searching by GUID be better for you than just clicking the link?


    No, the GUID is an EagleFiler thing. It’s only stored in EagleFiler’s database, not in the file itself.


    What are you trying to accomplish that isn’t currently possible?
    Well, I've outsmarted myself. I changed the name and directory of a database.
    As a result, none of the existing links to documents will work automatically. However, by manually substituting the correct directory, I should be able to recover any files that I did not move within EF.

    I also split the DB, putting half into a new one (which will eventually go on Dropbox). I expect in the new DB, all the docs will get a new GUID. In that case, even a searchable GUID would not have worked.

    So, this is a scenario in which some kind of unique ID for a file would be useful. One method would be to create my own, and simply put it in the file as a text comment. That works fine in a text or word processing file; in a PDF could I put it into the description section of the document. I think that is also a more robust solution, because any document can be found using Spotlight.

    Has anyone done something similar? Any suggestions? thanks

  8. #8

    Default

    As long as you don't move the file between disks, aliases do what you want — you can rename/move the file as much as you want and the alias will still resolve as you expect. (If you're populating your database programmatically, the user-facing term "alias" has been replaced by NSURL "bookmark"s, like "clipboard" vs "pasteboard").

  9. #9

    Default

    Quote Originally Posted by Rbohn View Post
    Well, I've outsmarted myself. I changed the name and directory of a database.
    As a result, none of the existing links to documents will work automatically. However, by manually substituting the correct directory, I should be able to recover any files that I did not move within EF.
    I would expect the links to still work even if the records were moved within EagleFiler.

    Quote Originally Posted by Rbohn View Post
    I also split the DB, putting half into a new one (which will eventually go on Dropbox). I expect in the new DB, all the docs will get a new GUID.
    When you copy a record from one EagleFiler library to another (or if you rebuild a library) it will keep the same GUID.

    It does seem to me that EagleFiler should handle this case better, though. Maybe if the library path in the link is invalid, check the other open libraries for that GUID?

  10. #10

    Default

    Quote Originally Posted by Michael Tsai View Post
    I would expect the links to still work even if the records were moved within EagleFiler.

    When you copy a record from one EagleFiler library to another (or if you rebuild a library) it will keep the same GUID.

    It does seem to me that EagleFiler should handle this case better, though. Maybe if the library path in the link is invalid, check the other open libraries for that GUID?
    Thanks for the advice. Yes, that should work if EF is interpreting the links. Although my understanding was that links (embedded in, for example, a word processing document) are handled by the OS, not EF itself. Clearly I should do some experiments if I really want to understand all this.

    In any case, I've decided to hand-embed a random ID into each document that I link to. That way, I can always use both Spotlight and EF's search to find the document, no matter where it wanders to.

  11. #11

    Default

    Quote Originally Posted by Rbohn View Post
    Yes, that should work if EF is interpreting the links. Although my understanding was that links (embedded in, for example, a word processing document) are handled by the OS, not EF itself.
    The OS doesn’t interpret the contents of EagleFiler links. If you click a link in another app, it will just launch EagleFiler and tell it to open the link.

Similar Threads

  1. a record for each application
    By humanengr in forum EagleFiler
    Replies: 1
    Last Post: 06-25-2011, 02:12 AM
  2. Open record in EagleFiler with Record Link
    By istib in forum EagleFiler
    Replies: 5
    Last Post: 03-09-2010, 12:38 PM
  3. Record Link in AppleScript
    By istib in forum EagleFiler
    Replies: 2
    Last Post: 02-28-2010, 02:03 PM
  4. Replies: 5
    Last Post: 02-11-2009, 01:13 PM
  5. Record Count
    By espinner in forum EagleFiler
    Replies: 1
    Last Post: 11-23-2008, 12:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •