Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Bingo! Worked perfect! I didn't see that console.log had been making problems whenever had worked. What I didn't know was that: Even though in the dictionary the name property is explicitly defined as "title", byName() still works; that parentheses are required to access the URL - bookmark.url( ) . Why should parentheses be necessary? Anyways, regardless of the "why", works like a charm. Thanks!
  2. Do you mean to say that the code you posted before did in fact work by you? JXA does work, before executing Javascript from an Applescript (or JXA for that matter) I had to authorize it (View > Developer > Allow JavaScript from Apple Events), only the bookmarks makes problems. If that exact code worked for you, that would be truly interesting. This is the closest I've gotten to anything. Invoking the app object's bookmarkFolders.title() yields an array with the names of both top-level bookmark folders. What to make of that, I'm not sure...
  3. So a couple things. Firstly, even if this had worked, wouldn't be of much help - I'd need to be working on identifying the ID of individual folders and bookmarks. At that point, I may as well hardcode the URL right into the script. In any event, even this didn't work. Because the AppleScript does work, swimmingly, I could easily find the id of the particular bookmark I am working with, and tried it out in JXA. Didn't get me far: Same when I tried var BMI = BMF.bookmarkItem.byId(457) It's definitely a Chrome issue. Possibl
  4. @CJK I don't know of having more than one Google Chrome. I just ran the code you suggested, and the result appears to be substantially identical.
  5. Yep, tried that, doesn't work. Here's what I get: Splitting the action into 2 - first getting the folder, then the bookmark item - changed little: Finally, trying to log the title (or id) of either the folder or the item, yielded the same error: A couple of observations: 1. The script doesn't go off track until the object is accessed, either with console.log or when trying to use the URL property. 2. Changing the name of the folder to gibberish changed nothing.
  6. Hi all! First post here. A workflow of mine involves having a script launch a bookmarklet in Google Chrome. I can, it is true, put the JS code to be executed directly into my script, but that means changing my code in 2 places every time I change something. So with Applescript, opening a bookmark in Chrome is trivial: tell application "Google Chrome" if not (exists window 1) then reopen set coef to URL of bookmark item "Coef" of bookmark folder "Bookmarks Bar" open location coef end tell But when trying this in JXA, everything goes to hell.
  • Create New...