Skip to content

Invoke macOS 10.14 Continuity Camera feature for image import

License

Notifications You must be signed in to change notification settings

miyako/4d-plugin-continuity-camera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

4d-plugin-continuity-camera

Invoke macOS 10.14 Continuity Camera feature for image import

version platform license downloads

Important: 2.0.0 breaks compatibility.

new status object:

  • status.success: boolean
  • status.document: picture (PDF document, if available)
  • status.images[]: collection of TIFF pictures, typically in 3 resolutions

Example

$options:=New object
$options.window:=Current form window
GET MOUSE($x;$y;$buttonDown)
$options.x:=$x
$options.y:=$y

$status:=Continuity camera menu ($options)

var $image : Picture

Form.image:=$image*0

If ($status.success)
	
	For each ($image; $status.images)
		Form.image:=Form.image/$image
	End for each 
	
	If ($status.document#Null)
		$folder:=Folder(Temporary folder; fk platform path).folder(Generate UUID)
		$folder.create()
		$file:=$folder.file("scan.pdf")
		PICTURE TO BLOB($status.document; $data; ".pdf")
		$file.setContent($data)
		SHOW ON DISK($file.platformPath)
	End if 
	
End if 

A context menu for image import is displayed.

menu

If there is an iOS device nearby with the same Apple ID, it will switch to Continuity Camera mode.

ipad

When you tap "Done", the command returns the image edited on iOS.