importing PDFs

classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|

importing PDFs

Antonio Fortin
Hi all,

Is there any way to import PDFs that don’t already have an entry in BibDesk? The idea would be that, if the PDF has no metadata (or that metadata is junk, which is usually the case, that this would just create a blank entry with the PDF attached to it.

Thanks,
Antonio
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Ken Mankoff
Drag and drop does this. Just drop between entries, not on a entry.

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard.

> On Sep 26, 2014, at 6:44, Antonio Fortin <[hidden email]> wrote:
>
> Hi all,
>
> Is there any way to import PDFs that don’t already have an entry in BibDesk? The idea would be that, if the PDF has no metadata (or that metadata is junk, which is usually the case, that this would just create a blank entry with the PDF attached to it.
>
> Thanks,
> Antonio
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Bibdesk-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
Thanks Ken. I’d like to be able to automate the importing of PDFs into BibDesk. I’m on a Mac, so what I do to add files to other apps is have Hazel (an automation assistant) monitor a folder and, depending on the tag a file has, it will open it in a specific app. That’s usually enough to import it into that app. However, with BibDesk, this doesn’t work - I get an error saying that the file isn’t a text file. I assume that this is because when one opens a file in BibDesk, it expects a library (.bib) rather than a binary file. Is there a different command I could use, or even an AppleScript, that would allow me to add a PDF?

I’m currently migrating from Papers to BibDesk, so this would also be helpful for that.

Antonio


On 26 Sep 2014, at 13:01, Ken Mankoff <[hidden email]> wrote:

> Drag and drop does this. Just drop between entries, not on a entry.
>
> Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard.
>
>> On Sep 26, 2014, at 6:44, Antonio Fortin <[hidden email]> wrote:
>>
>> Hi all,
>>
>> Is there any way to import PDFs that don’t already have an entry in BibDesk? The idea would be that, if the PDF has no metadata (or that metadata is junk, which is usually the case, that this would just create a blank entry with the PDF attached to it.
>>
>> Thanks,
>> Antonio
>> ------------------------------------------------------------------------------
>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Bibdesk-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Bibdesk-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Ken Mankoff

Yes you can automate it with applescript, but I'm not very familiar with
that system so I can't offer more advice.

  -k.

* On 2014-09-26 at 07:21, Antonio Fortin wrote:

> Thanks Ken. I’d like to be able to automate the importing of PDFs into
> BibDesk. I’m on a Mac, so what I do to add files to other apps is have
> Hazel (an automation assistant) monitor a folder and, depending on the
> tag a file has, it will open it in a specific app. That’s usually
> enough to import it into that app. However, with BibDesk, this doesn’t
> work - I get an error saying that the file isn’t a text file. I assume
> that this is because when one opens a file in BibDesk, it expects a
> library (.bib) rather than a binary file. Is there a different command
> I could use, or even an AppleScript, that would allow me to add a PDF?
>
> I’m currently migrating from Papers to BibDesk, so this would also be helpful for that.
>
> Antonio
>
>
> On 26 Sep 2014, at 13:01, Ken Mankoff <[hidden email]> wrote:
>
>> Drag and drop does this. Just drop between entries, not on a entry.
>>
>> Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard.
>>
>>> On Sep 26, 2014, at 6:44, Antonio Fortin <[hidden email]> wrote:
>>>
>>> Hi all,
>>>
>>> Is there any way to import PDFs that don’t already have an entry in BibDesk? The idea would be that, if the PDF has no metadata (or that metadata is junk, which is usually the case, that this would just create a blank entry with the PDF attached to it.
>>>
>>> Thanks,
>>> Antonio
>>> ------------------------------------------------------------------------------
>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Bibdesk-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>>
>> ------------------------------------------------------------------------------
>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Bibdesk-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Bibdesk-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Dr. Adam M. Goldstein PhD MSLIS-34
There are some scripts for downloading PDF's from ArXiv, so maybe looking at those will generate some ideas. I think the approach is to start an auto-file operation. Maybe Hazel can run a script to create a new record with dummy bibliography data and that then gives BD the appropriate auto-file location.

You can find the example scripts on the wiki, which I think you can get to from the help menu in BD.


————————
Adam M. Goldstein PhD, MSLIS
--
[hidden email]
http://www.shiftingbalance.org
http://www.twitter.com/z_californianus
--
http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=180621
----
Evolution: Education and Outreach
Senior Handling Editor
Reviews Editor
http://evolution-outreach.com
http://blogs.springeropen.com/eeo/
http://www.twitter.com/EEOBlogger

> On Sep 26, 2014, at 8:41, Ken Mankoff <[hidden email]> wrote:
>
>
> Yes you can automate it with applescript, but I'm not very familiar with
> that system so I can't offer more advice.
>
>  -k.
>
> * On 2014-09-26 at 07:21, Antonio Fortin wrote:
>> Thanks Ken. I’d like to be able to automate the importing of PDFs into
>> BibDesk. I’m on a Mac, so what I do to add files to other apps is have
>> Hazel (an automation assistant) monitor a folder and, depending on the
>> tag a file has, it will open it in a specific app. That’s usually
>> enough to import it into that app. However, with BibDesk, this doesn’t
>> work - I get an error saying that the file isn’t a text file. I assume
>> that this is because when one opens a file in BibDesk, it expects a
>> library (.bib) rather than a binary file. Is there a different command
>> I could use, or even an AppleScript, that would allow me to add a PDF?
>>
>> I’m currently migrating from Papers to BibDesk, so this would also be helpful for that.
>>
>> Antonio
>>
>>
>>> On 26 Sep 2014, at 13:01, Ken Mankoff <[hidden email]> wrote:
>>>
>>> Drag and drop does this. Just drop between entries, not on a entry.
>>>
>>> Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard.
>>>
>>>> On Sep 26, 2014, at 6:44, Antonio Fortin <[hidden email]> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Is there any way to import PDFs that don’t already have an entry in BibDesk? The idea would be that, if the PDF has no metadata (or that metadata is junk, which is usually the case, that this would just create a blank entry with the PDF attached to it.
>>>>
>>>> Thanks,
>>>> Antonio
>>>> ------------------------------------------------------------------------------
>>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> Bibdesk-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>>>
>>> ------------------------------------------------------------------------------
>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Bibdesk-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>>
>>
>> ------------------------------------------------------------------------------
>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Bibdesk-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Bibdesk-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman
In reply to this post by Antonio Fortin
AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add theFile to thePub
end tell
end tell

Christiaan

On Sep 26, 2014, at 13:21, Antonio Fortin wrote:

Thanks Ken. I’d like to be able to automate the importing of PDFs into BibDesk. I’m on a Mac, so what I do to add files to other apps is have Hazel (an automation assistant) monitor a folder and, depending on the tag a file has, it will open it in a specific app. That’s usually enough to import it into that app. However, with BibDesk, this doesn’t work - I get an error saying that the file isn’t a text file. I assume that this is because when one opens a file in BibDesk, it expects a library (.bib) rather than a binary file. Is there a different command I could use, or even an AppleScript, that would allow me to add a PDF?

I’m currently migrating from Papers to BibDesk, so this would also be helpful for that.

Antonio


On 26 Sep 2014, at 13:01, Ken Mankoff <[hidden email]> wrote:

Drag and drop does this. Just drop between entries, not on a entry.

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard.

On Sep 26, 2014, at 6:44, Antonio Fortin <[hidden email]> wrote:

Hi all,

Is there any way to import PDFs that don’t already have an entry in BibDesk? The idea would be that, if the PDF has no metadata (or that metadata is junk, which is usually the case, that this would just create a blank entry with the PDF attached to it.

Thanks,
Antonio
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Maxwell, Adam R-2

On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

> AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman

On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio





On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Ken Mankoff
How does that script know what theFile is?

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

On Sep 27, 2014, at 7:06, Antonio Fortin <[hidden email]> wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman
In reply to this post by Antonio Fortin
Of course this script won't do anything by itself. It is not complete, it is just a fragment for the relevant part related to BibDesk. You have to somehow pass the file to the script. I don't know if and how Hazel can do that.

Christiaan

On Sep 27, 2014, at 13:06, Antonio Fortin wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
In reply to this post by Ken Mankoff
In Hazel, `theFile` is an AppleScript variable that’s used to refer to the file being processed. In this case, it’s the PDF that’s tagged with the `BibDesk` tag, which triggers the rule.

—Antonio


On 27 Sep 2014, at 13:50, Ken Mankoff <[hidden email]> wrote:

How does that script know what theFile is?

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

On Sep 27, 2014, at 7:06, Antonio Fortin <[hidden email]> wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman
What format does theFile come in? Is it really a file object? Or is it a string? In the latter case you have to convert it to a file object.

Christiaan

On Sep 27, 2014, at 13:57, Antonio Fortin wrote:

In Hazel, `theFile` is an AppleScript variable that’s used to refer to the file being processed. In this case, it’s the PDF that’s tagged with the `BibDesk` tag, which triggers the rule.

—Antonio


On 27 Sep 2014, at 13:50, Ken Mankoff <[hidden email]> wrote:

How does that script know what theFile is?

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

On Sep 27, 2014, at 7:06, Antonio Fortin <[hidden email]> wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
In reply to this post by Christiaan Hofman
The Hazel rule I have does exactly that. I’ve tried running the script on its own, specifying an actual PDF rather than `theFile` (see below), and nothing happened.

`
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add "MBA:Users:antonio:foo.pdf" to thePub -- replace with path to your own PDF
end tell 
end tell
`

—Antonio

On 27 Sep 2014, at 13:52, Christiaan Hofman <[hidden email]> wrote:

Of course this script won't do anything by itself. It is not complete, it is just a fragment for the relevant part related to BibDesk. You have to somehow pass the file to the script. I don't know if and how Hazel can do that.

Christiaan

On Sep 27, 2014, at 13:06, Antonio Fortin wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman

On Sep 27, 2014, at 14:07, Antonio Fortin wrote:

The Hazel rule I have does exactly that. I’ve tried running the script on its own, specifying an actual PDF rather than `theFile` (see below), and nothing happened.

`
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add "MBA:Users:antonio:foo.pdf" to thePub -- replace with path to your own PDF
end tell 
end tell
`

—Antonio


That's a string, not a file object. You need to convert it to a file. So something like 

POSIX file "/MBA/Users/antonio/foo.pdf"

or

alias  "MBA:Users:antonio:foo.pdf"

(file "MBA:Users:antonio:foo.pdf" should work in theory but does not work in practice.)

That does work for me.

Christiaan

On 27 Sep 2014, at 13:52, Christiaan Hofman <[hidden email]> wrote:

Of course this script won't do anything by itself. It is not complete, it is just a fragment for the relevant part related to BibDesk. You have to somehow pass the file to the script. I don't know if and how Hazel can do that.

Christiaan

On Sep 27, 2014, at 13:06, Antonio Fortin wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
In reply to this post by Christiaan Hofman
`theFile` expands to the HFS path for the file, so it’s surprising that it stumps BibDesk.  

My (limited) understanding of file objects is that they’re only recognised by Finder and System Events.app. In any case, this still does nothing if I run it on its own (not as part of a Hazel rule):

`
set theFile to POSIX file "/Users/antonio/foo.pdf"
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add theFile to thePub
end tell
end tell
`

This just returns `file “MBA:Users:antonio:foo.pdf”` but doesn’t add the PDF to BibDesk.

—Antonio



On 27 Sep 2014, at 14:02, Christiaan Hofman <[hidden email]> wrote:

What format does theFile come in? Is it really a file object? Or is it a string? In the latter case you have to convert it to a file object.

Christiaan

On Sep 27, 2014, at 13:57, Antonio Fortin wrote:

In Hazel, `theFile` is an AppleScript variable that’s used to refer to the file being processed. In this case, it’s the PDF that’s tagged with the `BibDesk` tag, which triggers the rule.

—Antonio


On 27 Sep 2014, at 13:50, Ken Mankoff <[hidden email]> wrote:

How does that script know what theFile is?

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

On Sep 27, 2014, at 7:06, Antonio Fortin <[hidden email]> wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
In reply to this post by Christiaan Hofman
On 27 Sep 2014, at 14:20, Christiaan Hofman <[hidden email]> wrote:

On Sep 27, 2014, at 14:07, Antonio Fortin wrote:

The Hazel rule I have does exactly that. I’ve tried running the script on its own, specifying an actual PDF rather than `theFile` (see below), and nothing happened.

`
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add "MBA:Users:antonio:foo.pdf" to thePub -- replace with path to your own PDF
end tell 
end tell
`

—Antonio


That's a string, not a file object. You need to convert it to a file. So something like 

POSIX file "/MBA/Users/antonio/foo.pdf"

or

alias  "MBA:Users:antonio:foo.pdf"

(file "MBA:Users:antonio:foo.pdf" should work in theory but does not work in practice.)

That does work for me.

This *should* do it, right?

`
set posixPath to POSIX path of theFile
set newPDF to POSIX file of posixPath
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add newPDF to thePub
end tell
end tell
`

However, it doesn’t. Console shows a few BibDesk errors whenever I execute this script, but they have to do with MS Office and Spotlight. It looks like this is what’s causing the problem, but I have no idea how to go about fixing it.

Oh well, I’ll keep looking. Thanks for your help, Christiaan. If you have any ideas on how to fix this problem, I’d love to hear them.

—Antonio


On 27 Sep 2014, at 13:52, Christiaan Hofman <[hidden email]> wrote:

Of course this script won't do anything by itself. It is not complete, it is just a fragment for the relevant part related to BibDesk. You have to somehow pass the file to the script. I don't know if and how Hazel can do that.

Christiaan

On Sep 27, 2014, at 13:06, Antonio Fortin wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman
In reply to this post by Antonio Fortin

On Sep 27, 2014, at 14:25, Antonio Fortin wrote:

`theFile` expands to the HFS path for the file, so it’s surprising that it stumps BibDesk.  


Again, an HFS path is a string. It's not a file object. You have to make it in to a file object. So that's not surprising at all. Moreover, an HFS path is an anachronism,  leftover from classic mac. 

My (limited) understanding of file objects is that they’re only recognised by Finder and System Events.app.

Those are different file objects, that are defined in those apps. I am talking about generic file objects, that are defined in the basic AppleScript support itself. (The fact that they are different things is one reason why files in AppleScripts have always been a big mess.)

In any case, this still does nothing if I run it on its own (not as part of a Hazel rule):

`
set theFile to POSIX file "/Users/antonio/foo.pdf"
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add theFile to thePub
end tell
end tell
`

This just returns `file “MBA:Users:antonio:foo.pdf”` but doesn’t add the PDF to BibDesk.

—Antonio


Are you sure the file exists? If it doesn't, there is nothing to add. With an existing file, this does definitely work for me.

Christiaan

On 27 Sep 2014, at 14:02, Christiaan Hofman <[hidden email]> wrote:

What format does theFile come in? Is it really a file object? Or is it a string? In the latter case you have to convert it to a file object.

Christiaan

On Sep 27, 2014, at 13:57, Antonio Fortin wrote:

In Hazel, `theFile` is an AppleScript variable that’s used to refer to the file being processed. In this case, it’s the PDF that’s tagged with the `BibDesk` tag, which triggers the rule.

—Antonio


On 27 Sep 2014, at 13:50, Ken Mankoff <[hidden email]> wrote:

How does that script know what theFile is?

Please excuse brevity. Sent from pocket computer with tiny non-haptic feedback keyboard. 

On Sep 27, 2014, at 7:06, Antonio Fortin <[hidden email]> wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Christiaan Hofman
In reply to this post by Antonio Fortin

On Sep 27, 2014, at 15:32, Antonio Fortin wrote:

On 27 Sep 2014, at 14:20, Christiaan Hofman <[hidden email]> wrote:

On Sep 27, 2014, at 14:07, Antonio Fortin wrote:

The Hazel rule I have does exactly that. I’ve tried running the script on its own, specifying an actual PDF rather than `theFile` (see below), and nothing happened.

`
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add "MBA:Users:antonio:foo.pdf" to thePub -- replace with path to your own PDF
end tell 
end tell
`

—Antonio


That's a string, not a file object. You need to convert it to a file. So something like 

POSIX file "/MBA/Users/antonio/foo.pdf"

or

alias  "MBA:Users:antonio:foo.pdf"

(file "MBA:Users:antonio:foo.pdf" should work in theory but does not work in practice.)

That does work for me.

This *should* do it, right?

`
set posixPath to POSIX path of theFile
set newPDF to POSIX file of posixPath

set newPDF to POSIX file posixPath

(leave out the "of")

tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add newPDF to thePub
end tell
end tell
`

However, it doesn’t. Console shows a few BibDesk errors whenever I execute this script, but they have to do with MS Office and Spotlight. It looks like this is what’s causing the problem, but I have no idea how to go about fixing it.


That's strange. What errors? It seems their dictionary are messing up the language. that is actually far too common with AppleScript (one reason why it's such a failure of a language.)  Though it should not do this here, as it's all in a "tell application "BibDesk"" block. Perhaps there are scripting extensions in your ~/Library/ScriptingAdditions from those apps?

Christiaan

Oh well, I’ll keep looking. Thanks for your help, Christiaan. If you have any ideas on how to fix this problem, I’d love to hear them.

—Antonio


On 27 Sep 2014, at 13:52, Christiaan Hofman <[hidden email]> wrote:

Of course this script won't do anything by itself. It is not complete, it is just a fragment for the relevant part related to BibDesk. You have to somehow pass the file to the script. I don't know if and how Hazel can do that.

Christiaan

On Sep 27, 2014, at 13:06, Antonio Fortin wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|

Re: importing PDFs

Antonio Fortin
Okay, I’ve managed to get things working, more or less. I mistakenly thought the script was doing nothing, because nothing would happen visibly and, then, searching for the papers I was trying to add in BibDesk would find nothing. However, I tried the following, and it also selects the new paper:

`
set posixPath to POSIX path of theFile
set newPDF to POSIX file posixPath
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add newPDF to thePub
select thePub
end tell
end tell
`

There’s one more thing I’d like the script (or BibDesk) to do at the end, and that’s to either move or copy the linked PDF into the BibDesk papers folder. I’ve set the location for BibDesk to file papers, and I’ve also set it to file papers automatically (see attachment), but this doesn’t happen. The PDF remains in the location I saved it in.


Thanks for your help with this Christiaan!

Best,
Antonio

PS. I have no idea what the MS Office-related BibDesk errors were about, but they’re not happening any more.


On 27 Sep 2014, at 16:40, Christiaan Hofman <[hidden email]> wrote:


On Sep 27, 2014, at 15:32, Antonio Fortin wrote:

On 27 Sep 2014, at 14:20, Christiaan Hofman <[hidden email]> wrote:

On Sep 27, 2014, at 14:07, Antonio Fortin wrote:

The Hazel rule I have does exactly that. I’ve tried running the script on its own, specifying an actual PDF rather than `theFile` (see below), and nothing happened.

`
tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add "MBA:Users:antonio:foo.pdf" to thePub -- replace with path to your own PDF
end tell 
end tell
`

—Antonio


That's a string, not a file object. You need to convert it to a file. So something like 

POSIX file "/MBA/Users/antonio/foo.pdf"

or

alias  "MBA:Users:antonio:foo.pdf"

(file "MBA:Users:antonio:foo.pdf" should work in theory but does not work in practice.)

That does work for me.

This *should* do it, right?

`
set posixPath to POSIX path of theFile
set newPDF to POSIX file of posixPath

set newPDF to POSIX file posixPath

(leave out the "of")

tell application "BibDesk"
if (count of documents) is 0 then make new document
tell front document
set thePub to make new publication
add newPDF to thePub
end tell
end tell
`

However, it doesn’t. Console shows a few BibDesk errors whenever I execute this script, but they have to do with MS Office and Spotlight. It looks like this is what’s causing the problem, but I have no idea how to go about fixing it.


That's strange. What errors? It seems their dictionary are messing up the language. that is actually far too common with AppleScript (one reason why it's such a failure of a language.)  Though it should not do this here, as it's all in a "tell application "BibDesk"" block. Perhaps there are scripting extensions in your ~/Library/ScriptingAdditions from those apps?

Christiaan

Oh well, I’ll keep looking. Thanks for your help, Christiaan. If you have any ideas on how to fix this problem, I’d love to hear them.

—Antonio


On 27 Sep 2014, at 13:52, Christiaan Hofman <[hidden email]> wrote:

Of course this script won't do anything by itself. It is not complete, it is just a fragment for the relevant part related to BibDesk. You have to somehow pass the file to the script. I don't know if and how Hazel can do that.

Christiaan

On Sep 27, 2014, at 13:06, Antonio Fortin wrote:

Hi Christiaan,

Many thanks for that. However, when I trigger the script in Hazel, the PDF in question doesn’t get added to BibDesk. I know that the rest of the rule is working, because it does other things (like remove the tag).

I suspect I haven’t set it up correctly, however. I’ve attached a screenshot of the rule. Does it work for you, as it is?

I’ll almost always want to import to an existing library when BibDesk is already running, so I’m not worrying about the conditional statement or activating BibDesk just yet.

Thanks again.

Best,
Antonio

<hazelBibDesk.jpg>




On 26 Sep 2014, at 23:04, Christiaan Hofman <[hidden email]> wrote:


On Sep 26, 2014, at 19:54, Maxwell, Adam R wrote:


On Sep 26, 2014, at 08:17, Christiaan Hofman <[hidden email]> wrote:

AppleScript could very well do this. But how to write that AppleScript really depends on how you want to use it and what you want precisely to do. Probably you need some AppleScript like the following (here I assume theFile is the file you want to add):

The same script would also work if you have BD set to open a particular .bib file at launch, right? That would allow the OP to append new PDFs to the same .bib database.

Adam


Yes, it should. Though if you want to apply this also in cases where BibDesk should launch, then you probably also want to add an "activate" command somewhere. And I can imagine there may be timing issues (i.e. it checks for the count of documents before the initial file was launched), though a quick test does seem to work.

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Christiaan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
123