Jump to content

  •  

UPGRADE DEADLINE - SEPTEMBER 26, 2014!
FileMaker Inc. has a deadline for users of version 10,11, 12 as Individual box or volume licenses (with expired maintenance).
If you don't renew your maintenance and upgrade to FMP 13 you will no longer be eligible to upgrade, at the discount pricing.

Volume Licensing upgrade pricing for FileMaker Pro 13, FileMaker Pro 13 Advanced and FileMaker Server 13 will be discontinued.
Individual upgrade pricing for FileMaker Pro 13 and FileMaker Pro 13 Advanced will increase after September 26, 2014.
As of 27-September-2014, FileMaker 10 products will no longer be available for purchase or support.

http://help.filemaker.com/app/answers/detail/a_id/13865


Photo

Clipboard to variable


  • Please log in to reply
14 replies to this topic

#1 fed  enthusiast

fed
  • Members
  • 182 posts
  • LocationToronto, Canada
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Intermediate
  • Time Online: 1d 2h 46m 50s

Posted 27 January 2014 - 11:07 AM

I was wondering if there was a way to put the clipboard contents into a variable without putting it into a field first.  

 

Thanks,

 

Fed


  • 0

#2 Rick Whitelaw  Time Saver

Rick Whitelaw
  • Members
  • 691 posts
  • LocationToronto, Canada
  • FM Application:13 Advance
  • Platform:Mac OS X Lion
  • Skill Level:Intermediate
  • Membership:TechNet
  • Time Online: 21d 22h 53m 58s

Posted 27 January 2014 - 12:45 PM

Not that I know of, but if the data can be copied to the clipboard in the first place, then it should be available to the SetVariable script step without using the clipboard.

 

Of course I assume you mean to automate this. You can always copy the data to the clipboard and paste it into the SetVariable (specify) dialog.


Edited by Rick Whitelaw, 27 January 2014 - 12:47 PM.

  • 0

#3 Wim Decorte  Carpal Tunnel

Wim Decorte
  • Moderators
  • 3,513 posts
  • LocationToronto
  • FM Application:13 Advance
  • FMGo:iPhone / iPod Touch, iPad
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:7, 8, 9, 10, 11, 12, 13
  • Membership:TechNet
  • Time Online: 31d 18h 42m 3s

Posted 27 January 2014 - 12:47 PM

Nope


  • 0

#4 comment  consultant

comment
  • Members
  • 24,118 posts
  • Time Online: 326d 6h 12m 30s

Posted 27 January 2014 - 06:13 PM

I was wondering if there was a way to put the clipboard contents into a variable without putting it into a field first. 

 

Not natively, yes with a plugin such as BaseElements.


  • 0

#5 BruceR  consultant

BruceR
  • Members
  • 3,315 posts
  • LocationRedmond WA
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Expert
  • Certification:9, 11, 12
  • Membership:TechNet
  • Time Online: 30d 6h 59m 7s

Posted 27 January 2014 - 07:03 PM

It might also be useful to describe why you want to do this, including the source of the clipboard; and why using a field is not desirable. Note that the field could be a global field.


  • 2

#6 fed  enthusiast

fed
  • Members
  • 182 posts
  • LocationToronto, Canada
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Intermediate
  • Time Online: 1d 2h 46m 50s

Posted 27 January 2014 - 09:23 PM

The text in the clipboard is from the web viewer. It is The only way I found to get text from a webpage I need to access regularly. I'm trying not to use a browser and applescripts (which is what I'm using now).

If I paste it to a global field, I seem to loose all carriage returns and/or line feeds.

How do I paste it to the de variable dialogue using a script?

I've tried plugins before, but they have messed my database up so much, I'll never try it again.

Thanks for your help
  • 0

#7 comment  consultant

comment
  • Members
  • 24,118 posts
  • Time Online: 326d 6h 12m 30s

Posted 27 January 2014 - 09:58 PM

It looks like you are concentrating more on the things you're trying to avoid (fields, AppleScript, plugins) - all useful tools when used properly - then on the task at hand, which is not quite clear. Can't you get the text you need through scraping the content of the web viewer?

There's one thing I am fairly certain of: if the clipboard contains carriage returns, then so will the field you paste into; if it doesn't, then passing the clipboard to a variable will not create them.
  • 0

#8 BruceR  consultant

BruceR
  • Members
  • 3,315 posts
  • LocationRedmond WA
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Expert
  • Certification:9, 11, 12
  • Membership:TechNet
  • Time Online: 30d 6h 59m 7s

Posted 27 January 2014 - 10:08 PM

"If I paste it to a global field, I seem to loose all carriage returns and/or line feeds."

 

What makes you say that?

 

(You will have to define the global field as a text field)

 

See attached.

Attached Files


  • 0

#9 Wim Decorte  Carpal Tunnel

Wim Decorte
  • Moderators
  • 3,513 posts
  • LocationToronto
  • FM Application:13 Advance
  • FMGo:iPhone / iPod Touch, iPad
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:7, 8, 9, 10, 11, 12, 13
  • Membership:TechNet
  • Time Online: 31d 18h 42m 3s

Posted 28 January 2014 - 04:48 AM

The text in the clipboard is from the web viewer. It is The only way I found to get text from a webpage I need to access regularly. 

 

I'm with Comment on this: disregarding valid tools is not the right approach.  Also, using the clipboard and potentially destroying what the user has on it (and wants to keep on it, is considered bad form.

 

Note that you can get the content from a web viewer directly through the GetLayoutObjectAttribute function.


  • 0

#10 fed  enthusiast

fed
  • Members
  • 182 posts
  • LocationToronto, Canada
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Intermediate
  • Time Online: 1d 2h 46m 50s

Posted 28 January 2014 - 04:43 PM

Actually, I'm not trying to avoid anything. I have just tried all those things, and then of them work. I have even tried GetLayoutObjectAttribute, but that gives you the full HTML, which in these cases are huge. I am only interested in the resulting text.

 

I am trying to scrape the web viewer, that is entirely the point. Is there a way to do this using FileMaker? I was not aware that was something FMP offered. I have searched long and hard for that. Could you please point me in the right direction?

 

If I manually copy the contents of the web viewer onto the clipboard, and then paste it to a text program, such as TextEdit (on OSX), then the carriage returns and/or linefeeds work just fine. If I paste the exact same thing, again manually, into a field (which is global and is a text field) then these carriage returns and/or linefeeds disappear. It is all just one long paragraph. I'm not sure what is going on, it seems a bit strange to me.

 

Thanks again for commenting on this.


  • 0

#11 comment  consultant

comment
  • Members
  • 24,118 posts
  • Time Online: 326d 6h 12m 30s

Posted 28 January 2014 - 05:02 PM

If I manually copy the contents of the web viewer onto the clipboard, and then paste it to a text program, such as TextEdit (on OSX), then the carriage returns and/or linefeeds work just fine. If I paste the exact same thing, again manually, into a field (which is global and is a text field) then these carriage returns and/or linefeeds disappear. It is all just one long paragraph. I'm not sure what is going on, it seems a bit strange to me.

 

It seems strange to me too. Could you post an URL, so that we can try and reproduce the issue?

 

 

I am trying to scrape the web viewer, that is entirely the point.

 

By "scraping the web viewer" I meant processing the result of GetLayoutObjectAttribute() - i.e the entire HTML. Again, it's hard to be specific without seeing the actual HTML code, but usually there will be an "anchor" you can hook onto in order to parse out the data you need. It's not an ideal method, but IMHO it's the best route to follow if the data cannot be accessed through a web service or some other form of API.


  • 0

#12 fed  enthusiast

fed
  • Members
  • 182 posts
  • LocationToronto, Canada
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Intermediate
  • Time Online: 1d 2h 46m 50s

Posted 31 January 2014 - 09:50 AM

It seems that GetLayoutObjectAttribute() only gives me the HTML code on the dynamic page, not the resulting text.

Am I missing something?
  • 0

#13 comment  consultant

comment
  • Members
  • 24,118 posts
  • Time Online: 326d 6h 12m 30s

Posted 31 January 2014 - 09:59 AM

I am not sure what you mean by "the dynamic page". Usually (but not always) the text is found inside the HTML code. HTML is a mark-up language and HTML code contains text (data) and mark-up (metadata). The idea of "scraping" is to extract the data and discard the mark-up.


  • 0

#14 fed  enthusiast

fed
  • Members
  • 182 posts
  • LocationToronto, Canada
  • FM Application:13 Advance
  • Platform:Mac OS X Mountain Lion
  • Skill Level:Intermediate
  • Time Online: 1d 2h 46m 50s

Posted 31 January 2014 - 10:04 AM

The page is JavaScript and extracts info from a database and presents it on the webpage.

The HTML has no text. The text is generated by JavaScript.
  • 0

#15 comment  consultant

comment
  • Members
  • 24,118 posts
  • Time Online: 326d 6h 12m 30s

Posted 31 January 2014 - 10:12 AM

If that is the case, then you indeed have no choice other than copy the rendered content and paste it somewhere for further processing. So it seems we are back to the carriage returns question. Any chance of enabling us to reproduce the issue?


  • 0




FMForum Advertisers